sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
516 stars 77 forks source link

Increase phpstan from level 6 to level 8 #251

Closed phil-davis closed 1 year ago

phil-davis commented 1 year ago

This seems to be possible without breaking the code ;)

codecov[bot] commented 1 year ago

Codecov Report

Merging #251 (fe75c5e) into master (d7cad5f) will decrease coverage by 0.16%. Report is 2 commits behind head on master. The diff coverage is 92.85%.

@@             Coverage Diff              @@
##             master     #251      +/-   ##
============================================
- Coverage     96.90%   96.75%   -0.16%     
+ Complexity      116      115       -1     
============================================
  Files            13       13              
  Lines           485      493       +8     
============================================
+ Hits            470      477       +7     
- Misses           15       16       +1     
Files Changed Coverage Δ
lib/Element/Base.php 100.00% <ø> (ø)
lib/Deserializer/functions.php 89.21% <85.71%> (-0.48%) :arrow_down:
lib/Element/Uri.php 100.00% <100.00%> (ø)
lib/Reader.php 97.50% <100.00%> (ø)
lib/Service.php 98.61% <100.00%> (+0.01%) :arrow_up:
lib/Writer.php 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

phil-davis commented 1 year ago

I will also try to add some unit tests that pass non-existent functions/methods to functionCaller and see if I can cover the exceptions that should be thrown.

phil-davis commented 1 year ago

@staabm I reorganized the if-else... block in functionCaller so that it does not need to explode strings like "MyClass::someMethod". That avoids phpstan getting confused about what the exploded array is (it is still callable, but phpstan can't guess that).

I thin kthis is enough on this! Please review and I will merge if OK.