🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Buggy docblock type inferrence since phpstan 2.2.6 #15043

Description

@indykoning

Bug report

Since updating to PHPStan 2.2.6 there seem to be some issues with type inference of docblocks.
e
In one run of phpstan it seems to completely ignore the docblocks
e.g.

    /**
     * @var string
     */
    protected $_code = 'test';

Property $_code has no type specified.

Then the next run it's completely fine and it validates the file without issue.

EDIT: This seems to be caused by Turbo since PHPSTAN_TURBO=0 phpstan analyse does run as expected

Code snippet that reproduces the problem

No response

Expected output

I would expect the phpstan output to be consistent, and to respect the values entered as docbloc.
In the example in my bug report i fixed the complaint, downgraded to 2.2.5 where it ran fine. Upgraded back up to 2.2.7 and then it was fixed there as well. This was due to result caching.

Did PHPStan help you today? Did it make you happy in any way?

PHPStan is an invaluable part of my workflow, paired with Rector i don't mind fixing the issues it flags leaving my installations much more stable than ever before!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions