apollo-federation-php icon indicating copy to clipboard operation
apollo-federation-php copied to clipboard

chore: improve static analysis, bump min PHP to 7.4, support PHP 8.2

Open ramsey opened this issue 3 years ago • 5 comments

Proposed changes

  • Adds a lot of new tooling for static analysis
  • Bumps the minimum PHP version to 7.4
  • Supports PHP 8.1 and 8.2
  • Runs CI builds on PHP versions 7.4 through 8.2

Since this adds parameter types and return types in many places where there were none, this can break BC for applications using this and extending classes or passing the wrong values into methods. As such, I recommend bumping the package's major version when doing the next release (after this is merged).

🚨 This stands to cause a lot of merge conflicts with #26. I'm not sure how we want to handle that. Which should we merge first?

How to test

  • composer test

Unit Tests

  • [x] This PR has unit tests: updates to the unit tests, as needed
  • [ ] This PR does not have unit tests: why?

ramsey avatar Dec 15 '22 01:12 ramsey

@ramsey please release PR #26. I think it's more important to add support of federation v2 rather than analytic and support of php 8.1.

Makapashev avatar Dec 19 '22 08:12 Makapashev

@ramsey my two cents, #26 should go first given it's been open for a really long time and will get even more delayed if there are merge conflicts. Also, +1 to @Makapashev's comment.

ldiego08 avatar Dec 19 '22 12:12 ldiego08

@ramsey You may add code coverage baseline to control that it is not downgraded with new PRs :)

https://github.com/Aeliot-Tm/phpunit-codecoverage-baseline

Aeliot-Tm avatar Feb 10 '23 18:02 Aeliot-Tm

@Aeliot-Tm would you consider such code coverage baseline a blocker for getting this PR in a mergeable state? or could it be handled through a follow-up?

rvanlaak avatar May 30 '23 11:05 rvanlaak

@ramsey any reason why both PHPStan and Psalm as static code analysis tools are added? Yes they can capture marginally different things, but solely starting with PHPStan with a baseline file might be a more controllable way of adding static analysis (e.g. as all future contributors will also have to work with it)?

rvanlaak avatar May 30 '23 11:05 rvanlaak