Skip to content

Conversation

swissspidy
Copy link
Member

Supersedes #204

  • Add required composer packages for PHPStan
  • Add szepeviktor/phpstan-wordpress as PHPStan extension for WordPress
  • Add script to run test "phpstan": "run-phpstan-tests",
  • Add run-phpstan-tests file in bin folder

Fixes #203

@swissspidy swissspidy requested a review from a team as a code owner May 15, 2025 20:33
@swissspidy swissspidy marked this pull request as draft May 15, 2025 20:33
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 145 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/FeatureContext.php 0.00% 87 Missing ⚠️
src/Context/GivenStepDefinitions.php 0.00% 25 Missing ⚠️
src/Context/ThenStepDefinitions.php 0.00% 19 Missing ⚠️
src/Context/Support.php 0.00% 9 Missing ⚠️
src/Context/WhenStepDefinitions.php 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy marked this pull request as ready for review May 15, 2025 21:41
@swissspidy
Copy link
Member Author

Confirmation that PHPStan runs on GitHub Actions too: https://github.com/wp-cli/wp-cli-tests/actions/runs/15065002933/job/42348320172

@swissspidy swissspidy merged commit 4865fa1 into main May 16, 2025
50 checks passed
@swissspidy swissspidy deleted the 203-add-phpstan branch May 16, 2025 09:25
@swissspidy swissspidy added this to the 4.3.17 milestone May 16, 2025
@@ -15,6 +15,9 @@
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "dev-develop",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^1.12.26",
"szepeviktor/phpstan-wordpress": "^v1.3.5",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is a new addition, it'd be better to start with 2.0?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't, because we currently require PHP 7.2+, but v2 requires PHP 7.4+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok. Makes sense.

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

Successfully merging this pull request may close these issues.

Add PHPStan support
3 participants