Skip to content

Add phpstan-no-private to catch calls of seemingly private functions #776

Open
@westonruter

Description

@westonruter

Feature Description

As suggested by @swissspidy in #730 (comment):

I can also highly recommend https://packagist.org/packages/swissspidy/phpstan-no-private to catch calls of seemingly private functions.

Nevertheless, I noted:

I love this package, but I wonder if this is the best for Performance Lab considering that the code in question will end up in core and thus it is expected that many calls to internal/private functions will be made? As it stands right now...

And in response, @swissspidy:

Good point! 😃

I think it can't hurt to use it anyway, since not everything will land in core. Places where usage is OK can be ignored in the PHPStan config accordingly. But maybe in another PR :-)

All the Perflab_SQLite_ reports are actually false positives! I'll get this fixed in a new release. (Edit: see swissspidy/phpstan-no-private#2)
They are not properly documented though. A private function ...() method does not need @access private annotations. That's against the coding standards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssues for the overall performance plugin infrastructure[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin only[Type] EnhancementA suggestion for improvement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions