Skip to content

Bug: Throttler check method signed as @internal #9813

Description

@MatuzMark

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions