Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OnHold|Feat] Add PhpStan #211

Closed
wants to merge 30 commits into from

Conversation

olivernybroe
Copy link
Collaborator

@olivernybroe olivernybroe commented Jul 5, 2019

Q A
Bug fix? no
New feature? yes
Fixed tickets #165

This PR adds support for phpstan.
It takes the same approach as the sniffers and actually uses the same file processor class.

The PR is based off the new formatter branch #201, as I didn't want to implement the HasDetails interface twice. So it is on hold until the formatter branch is merged in.

  • Some refactoring of InsightFactory is required, as the naming in there and so on is kinda random now, as it also handles rules from phpstan and not only sniffs.
  • Again refactoring, but this time look at the RuleDecorator class.
  • Maybe add some phpstan rules (currently only 1 is added) (any help on this appreciated!)
  • Add docs about phpstan...
  • And if not too lazy. then tests
  • Add support for excludes on a phpstan rule

resolves: #165

@nunomaduro
Copy link
Owner

This will be huge.

@olivernybroe olivernybroe added the enhancement New feature or request label Jul 11, 2019
Removed the usage of ECS container:
We now handle the file processors ourself in the runner class

Added more phpstan rules:
We now use a lot more rules from phpstan

Fixed a bug with non autoloaded files:
Files which is not part of the autoload did not work with phpstan.

Removed the need for phpstan analyser:
We now only use the parser, this improves the speed a lot

Merged sniff insight and sniff decorator together:
The sniff insights and decorator are now 1 class instead of two

Removed errorAndDiffCollector:
We don't use the collector anymore. We now store the sniff errors
inside the sniff itself.
@olivernybroe
Copy link
Collaborator Author

This latest commit is a rather large refactoring.

It makes some gigantic changes to the whole structure of how we run everything.
These changes actually means we do not need ECS anymore and can remove that dependency while actually simplifying our code at the same time.

(Sorry that this PR is getting out of the scope for adding phpstan only)

@olivernybroe
Copy link
Collaborator Author

Closing this PR as there is soo many changes since I made this that it's probably quicker to start over...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PHPStan wrapper
2 participants