-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
PHP Version
8.3
CodeIgniter4 Version
latest (4.6.3)
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
Running PHPStan with bleeding edge option results in strange error:
:38 Call to internal method CodeIgniter\Throttle\Throttler::check() from outside its root namespace CodeIgniter.
🪪 method.internal
✏️ app/Filters/Throttle.php:38
I think it was originally implemented in v4.0.0: 5927784
Steps to Reproduce
Create a minimal code like:
service('throttler')->check('', 30, MINUTE);
// if https://github.com/CodeIgniter/phpstan-codeigniter is not installed, then:
\Config\Services::throttler()->check('', 30, MINUTE);Enable PHPStan (>= v2.1) Bleeding Edge and run PHPStan.
Expected Output
No PHPStan error.
Anything else?
The error occurs only with Bleeding option turned on.
Can be tested on: https://phpstan.org/r/c0e29b02-3357-4cd0-b4ba-ef782002746a
I think the annotation should be removed in Throttler class.
I also think the annotation in HotReloader should be removed (because it is called in app/Config/Events.php