Closed Miraeld closed 1 day ago
Coverage variation | Diff coverage |
---|---|
Report missing for 90ca318cece30d1c6404e86cc885795163a95ba1[^1] | :white_check_mark: ∅ (target: 50.00%) |
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
I've treated your feedback @CrochetFeve0251 , Also, modified the way it was working a bit to comply with your tests.
Also, you'll notice I've added some // @php-stan-ignore-[next]-line
That's because when phpstan run within this class, it kinda gets messed up with some type, even tho it's explicit, and due to this it thinks some part of the code are unreachable while in real they are.
I add a screenshot of your test passing as it isn't part of the CI in here.
Description
Fixes #7123
This won't impact users.
Type of change
Detailed scenario
Just run PHPStan
Technical description
Documentation
This pull request introduces several changes related to PHPStan integration and testing in the project. The most significant updates include adding new PHPStan rules and tests, modifying the configuration files, and ensuring callback methods exist in subscribed events.
PHPStan Integration and Configuration:
composer.json
: Added new scripts to run PHPStan with specific options (run-stan-reset-baseline
,run-stan-test
).phpstan.neon.dist
: Updated parameters to include new paths and rules, and modified reporting settings. [1] [2]New PHPStan Rule:
tests/phpstan/Rules/EnsureCallbackMethodsExistsInSubscribedEvents.php
: Implemented a new PHPStan rule to ensure callback methods exist in subscribed events.Tests for New Rule:
tests/phpstan/tests/Rules/EnsureCallbackMethodsExistsInSubscribedEventsTest.php
: Added tests to validate the new PHPStan rule, including tests for valid subscribers, non-existing methods, and complex syntax.tests/phpstan/tests/data/EnsureCallbackMethodsExistsInSubscribedEventsTest/complex-syntax.php
tests/phpstan/tests/data/EnsureCallbackMethodsExistsInSubscribedEventsTest/not-existing.php
tests/phpstan/tests/data/EnsureCallbackMethodsExistsInSubscribedEventsTest/valid.php
PHPUnit Configuration:
tests/phpstan/tests/bootstrap.php
: Added bootstrap file for PHPUnit tests.tests/phpstan/tests/phpunit.xml
: Added PHPUnit configuration file to define test suites and coverage settings.New dependencies
None
Risks
None
Mandatory Checklist
Code validation
Code style