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

ci: Add PHPStan #811

Merged
merged 1 commit into from May 30, 2023
Merged

ci: Add PHPStan #811

merged 1 commit into from May 30, 2023

Conversation

@jtojnar jtojnar changed the title Locator: add type hints ci: Add PHPStan Mar 18, 2023
Comment on lines 49 to 50
- name: Run static analysis
run: composer phpstan
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jtojnar jtojnar force-pushed the phpstan branch 6 times, most recently from 8bfc333 to 7b1733b Compare March 19, 2023 13:50
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@jtojnar jtojnar force-pushed the phpstan branch 5 times, most recently from 7455cc4 to 1277b4c Compare March 19, 2023 23:11
src/IRI.php Outdated
* @property ?string $scheme
* @property ?string $userinfo
* @property ?string $host
* @property ?int $port
Copy link
Contributor Author

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:

Suggested change
* @property ?int $port
* @property-read int|null $port
* @property-write int|string|null $port

But that is not currently supported phpstan/phpstan#9062

@jtojnar
Copy link
Contributor Author

jtojnar commented Apr 2, 2023

Dropped #792 and #785 from dependencies since they are not necessary for level 2 but they will be needed for higher levels.

@jtojnar jtojnar marked this pull request as ready for review April 2, 2023 05:03
This should prevent whole swathes of bugs, especially once we increase the rule level.
@mblaney mblaney merged commit 98ed1a7 into simplepie:master May 30, 2023
8 checks passed
@jtojnar jtojnar deleted the phpstan branch May 30, 2023 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants