cakephp-codesniffer icon indicating copy to clipboard operation
cakephp-codesniffer copied to clipboard

Update for PHP 8.1+

Open dereuromark opened this issue 3 years ago • 4 comments

First stab at https://github.com/cakephp/cakephp-codesniffer/issues/368

It will also require test harness to be fixed up for 8.1+

Declaration of PHP_CodeSniffer\Tests\TestSuite::run(?PHPUnit\Framework\TestResult $result = null) must be compatible with PHPUnit\Framework\TestSuite::run(?PHPUnit\Framework\TestResult $result = null): PHPUnit\Framework\TestResult

As well as (follow-ups?):

  • Move tests into tests/ with proper autoload-dev instead of part of autoload

dereuromark avatar Dec 27 '22 21:12 dereuromark

I enabled for now the full set of mult-line declarations, just for testing We can redude this once we are ready for merging if it is too disruptive and only keep 1 of the 3 pairs

For now the pressing question is how to get the tests working on modern versions of dependencies.

dereuromark avatar Jan 01 '23 14:01 dereuromark

Anyone any ideas on the blocker of tests getting green again?

dereuromark avatar Mar 20 '23 22:03 dereuromark

Whats the state of this PR?

LordSimal avatar Jul 03 '23 18:07 LordSimal

This looks like it needs a bit of rework now. I would still like to see it added

dereuromark avatar Jul 12 '23 21:07 dereuromark

@dereuromark I see you have added a few more rules regarding trailing comma besides the one I added in #398. So if you want to get them into the next minor now would be the time.

BTW PER 2.0 has added rules regarding trailing comma, so it would be good to follow that https://www.php-fig.org/per/coding-style/#26-trailing-commas

phpcs still doesn't seem to have a PER 2.0 rules set but hopefully it will have one soon making things easier for it.

ADmad avatar Nov 29 '24 17:11 ADmad

I rebased and ran a test con cakephp/cakephp: 266 more files changed on the function signatures, not sure if we want to do this too The benefit would be less merge conflicts in the future.

dereuromark avatar Nov 30 '24 03:11 dereuromark

I ran into https://github.com/slevomat/coding-standard/issues/1715 by the way, also happens without my updates, so this is an issue we need to tackle separately..

dereuromark avatar Nov 30 '24 04:11 dereuromark

266 more files changed on the function signatures, not sure if we want to do this too

That's fine, better to stay consistent about the trailing comma along all constructs. It's not a problem as long as it's auto fixable.

I ran into https://github.com/slevomat/coding-standard/issues/1715 by the way

The slevomat guys a usually pretty responsive, so hopefully should be resolved soon.

ADmad avatar Nov 30 '24 04:11 ADmad

I added PHPStan. For level 7 there seem to be only a few issues, but we can tackle them also separately afterwards.

dereuromark avatar Nov 30 '24 04:11 dereuromark