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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add Static Analysis via PHPStan #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

owenvoke
Copy link
Contributor

This adds static analysis of the package via PHPStan. 馃憤馃徎

I've currently baselined the existing issues, and this should probably be worked through to reduce this so that the baseline can be removed. 馃憣馃徎 Some of the things like the curl_* function issues at the bottom can't easily be removed as CurlHandle isn't available on PHP 7.x, so unless PHP 7 is dropped, this probably can't be addressed.

However, it has drawn attention to issues like dynamically-declared properties (which are removed in PHP 8.2).

@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2023

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ilvalerione
Copy link
Member

Just to be sure let me ask you:
The baselined issues exist because Transaction, Segment, and Error are array objects to which properties are dynamically added. PHPStan doesn't recognize it and see a lot of undefined properties?

@owenvoke
Copy link
Contributor Author

owenvoke commented Mar 1, 2023

Yes, as far as I can tell, that is correct. 馃 I guess this should be possible to resolve with generics, or by specifying the properties as docblocks. 馃し馃徎 Or adding the properties so that they aren't within an array.

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.

None yet

2 participants