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

Make data array variable type within Report more precise #332

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Dec 17, 2023

Just a minor issue that PHP stan found in our project:

Error: Parameter #1 $data of class Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Report constructor expects array<string, string>, array<string, int|string> given.
 ------ ---------------------------------------------------------------------- 
  Line   core-bundle/tests/EventListener/CspReportListenerTest.php             
 ------ ---------------------------------------------------------------------- 
  47     Parameter #1 $data of class                                           
         Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Report          
         constructor expects array<string, string>, array<string, int|string>  
         given.                                                                
 ------ ---------------------------------------------------------------------- 

The JSON data sent by the browser can in fact also have integers for the following keys:

  • column-number
  • line-number
  • status-code

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (da7cc88) 96.93% compared to head (f7a2bde) 96.93%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #332   +/-   ##
=========================================
  Coverage     96.93%   96.93%           
  Complexity      429      429           
=========================================
  Files            52       52           
  Lines          1923     1923           
=========================================
  Hits           1864     1864           
  Misses           59       59           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fritzmg
Copy link
Contributor Author

fritzmg commented Dec 18, 2023

Not sure how to fix the other issues reported by PHP stan. This methods do in fact only ever return a string or null.

fritzmg referenced this pull request in contao/contao Jan 15, 2024
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