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
ci: Add PHPStan #811
ci: Add PHPStan #811
Conversation
.github/workflows/ci.yml
Outdated
- name: Run static analysis | ||
run: composer phpstan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about running PHPStan before running composer test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use yoast/phpunit-polyfills
, PHPUnit will not be available until tests are run.
8bfc333
to
7b1733b
Compare
7455cc4
to
1277b4c
Compare
src/IRI.php
Outdated
* @property ?string $scheme | ||
* @property ?string $userinfo | ||
* @property ?string $host | ||
* @property ?int $port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For level 3, we would need something like:
* @property ?int $port | |
* @property-read int|null $port | |
* @property-write int|string|null $port |
But that is not currently supported phpstan/phpstan#9062
This should prevent whole swathes of bugs, especially once we increase the rule level.
Ideally, this would prevent issues like #802, #810, …
But this is just a beginning, targetting level 2 for now.
Depends on: