fix: phan and psalm and PHPStan issues#497
fix: phan and psalm and PHPStan issues#497Apoorva64 wants to merge 7 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
============================================
- Coverage 83.46% 82.48% -0.98%
- Complexity 2330 2383 +53
============================================
Files 149 162 +13
Lines 8791 8959 +168
============================================
+ Hits 7337 7390 +53
- Misses 1454 1569 +115 Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
``` Error: Ignored error pattern #Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface::.*# in path /home/runner/work/opentelemetry-php-contrib/opentelemetry-php-contrib/src/Sampler/RuleBased/src was not matched in reported errors. ```
…quire-dev so that psalm can see the class used in testing
|
Is it possible to enable auto approve for the workflows for this PR ? |
|
all php phan and psalm and PHPStan have been fixed. The remaning errors are phpunit tests to be fixed by #494 |
|
@bobstrecansky Can we merge this one? or should we include #494 in the current PR |
|
Hi @Apoorva64 are the failing symfony tests related to these changes? Asking because I see some symfony changes... |
|
@brettmc no the current changes in this PR are not related, you can run the symfony tests on current main to confirm this |
This PR fixes the current PHP Psalm and Phan issues on
main.1. Psalm:
src/Sampler/RuleBased/psalm.xml.distIssue:
UndefinedInterfaceMethodis needed only for PHP 8.1. For newer PHP versions, Psalm reports:Fix: Disable
findUnusedIssueHandlerSuppressionto prevent the “Suppression not used” error.Reference: [Psalm docs](https://psalm.dev/docs/running_psalm/issues/UnusedIssueHandlerSuppression/)
2. PHPStan:
src/Sampler/RuleBased/phpstan.neon.distIssue:
NodeParentInterfacesuppression is needed for PHP 8.1, but for newer versions, PHPStan reports:Fix: Add
reportUnmatchedIgnoredErrors: false.Reference: [PHPStan ignoring errors guide](https://phpstan.org/user-guide/ignoring-errors#reporting-unused-ignores)
3. Phan:
src/SymfonyInstrumentation.phpRemove deprecated constant:
TraceAttributes::EXCEPTION_ESCAPED => trueReason:
4. Psalm: Suppress unused function call
Issue: Psalm reports an unused function call for the terminate hook:
Fix: Add an
UnusedFunctionCallsuppression for this line.5. Dev Dependencies
Issue: Psalm cannot see certain classes in tests:
Fix: Add
open-telemetry/opentelemetry-propagation-traceresponseas a dev dependency.