vobject icon indicating copy to clipboard operation
vobject copied to clipboard

Type declarations to increase phpstan to level 6

Open phil-davis opened this issue 2 years ago • 8 comments

  1. Bump dependencies in composer.json

  2. Bump phpstan to level 6

  3. WIP - fixup type declarations (test code)

  4. ToDo - fixup type declarations (real code)

Towards issue #588

phil-davis avatar Sep 11 '22 16:09 phil-davis

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (154a84d) 98.76% compared to head (18494f5) 98.68%.

:exclamation: Current head 18494f5 differs from pull request most recent head 6f8d36e. Consider uploading reports for the commit 6f8d36e to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #591      +/-   ##
============================================
- Coverage     98.76%   98.68%   -0.08%     
+ Complexity     1866     1865       -1     
============================================
  Files            71       71              
  Lines          5325     5329       +4     
============================================
  Hits           5259     5259              
- Misses           66       70       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 11 '22 16:09 codecov[bot]

"progress" report: phpstan [ERROR] Found 638 errors

There were 880 errors, I have fixed 242 - that is 27.5% done! This is a painful job.

phil-davis avatar Sep 11 '22 16:09 phil-davis

Types are declared in all test code. Found 493 errors Nearly half way. And then need to review what happened and try to tidy it all up, be consistent, and provide the "reasonable most" specific type declarations at each point.

phil-davis avatar Sep 13 '22 08:09 phil-davis

Note to interested people: I have had "other things" happening the last few months. This work here is volunteer work. Hopefully I will get enthusiastic about it again "real soon now" (tm) and have some time to put in.

If anyone else wants to do this stuff, or help with it, feel free to ping me here and we can work out how to move forward.

phil-davis avatar Jan 17 '23 05:01 phil-davis

Rebased and resolved conflicts. Maybe I can get more work done on this "soon".

composer phpstan
...
Found 541 errors

phil-davis avatar Jan 23 '23 04:01 phil-davis

https://github.com/sabre-io/vobject/actions/runs/3985955698/jobs/6833950107

Found 389 errors

phil-davis avatar Jan 23 '23 11:01 phil-davis

I rebased, resolved conflicts, applied the latest cs-fixer code-style changes. Now phpstan level 6 reports "only":

[ERROR] Found 382 errors

This looks like a big job.

phil-davis avatar Nov 15 '23 05:11 phil-davis

I tried to address some stuff here as well https://github.com/sabre-io/vobject/pull/628/commits

DeepDiver1975 avatar Nov 15 '23 06:11 DeepDiver1975