Skip to content

rector-laravel and phpstan combo conflicts with the package #1404

@xHeaven

Description

@xHeaven

Describe the bug
Implementing the Activity interface, implementing its methods and running driftingly/rector-laravel, then running PHPStan conflicts.
The reason is this PR in rector-laravel: driftingly/rector-laravel#370

Rector will mark all my scopes protected (correct), including those that are coming from this package - which are marked as public in the interface.
Then, PHPStan complains about them being protected, since the interface declares them as public.

To Reproduce
Implement Activity on a model class, implement its methods, run Rector (with the laravel extension), then PHPStan.

Now a solution would be excluding my models that implement Activity from Rector's rule, but I don't feel like that's the correct way to do it.
Since you can't have non-public members in interfaces, just changing the interface won't work either.

Are you open for a bit of refactoring on this?

Scopes are not supposed to be public anyway, a user should never call those methods directly, so the Rector fix makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions