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

Mark support for slevomat/coding-standard ^8.0 #363

Merged
merged 1 commit into from Jul 4, 2022

Conversation

MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Jul 3, 2022

PR marks compatibility of this library with the ^8.0 line of slevomat/coding-standard. The big reason (for me) to do this is that the 8.0.1 release of slevomat/coding-standard had a fix to work with the latest versions of phpstan, for the following runtime error:

PHP Fatal error:  Uncaught TypeError: Argument 5 passed to SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation::__construct() must be an instance of PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode or null, instance of PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode given, called in /home/runner/work/phinx/phinx/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php on line 357 and defined in /home/runner/work/phinx/phinx/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php:31
Stack trace:
#0 /home/runner/work/phinx/phinx/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php(357): SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation->__construct('@param', 74, 76, '$result', Object(PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode))
#1 /home/runner/work/phinx/phinx/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(42): SlevomatCodingStandard\Helpers\Annota in /home/runner/work/phinx/phinx/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php on line 31

I checked and it does not look like this library makes use of any of the things that were removed in the 8.0.0 release.

Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
@ADmad
Copy link
Member

ADmad commented Jul 3, 2022

8.0 does has a breaking sniff rename which affects us, SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing was renamed to SlevomatCodingStandard.Classes.PropertyDeclaration.

@ADmad
Copy link
Member

ADmad commented Jul 3, 2022

We can bump the minor version though and keep only 8.0+ as a dependency.

@MasterOdin
Copy link
Member Author

MasterOdin commented Jul 3, 2022

I don't see SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing referenced in the ruleset.xml (I do see the similarly named SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing). Is it used as part of a custom ruleset outside of this library?

@ADmad
Copy link
Member

ADmad commented Jul 4, 2022

My bad. We had used that sniff on the 5.x branch, it's not used for 4.x.

ADmad
ADmad approved these changes Jul 4, 2022
@ADmad ADmad requested a review from othercorey Jul 4, 2022
@othercorey othercorey merged commit 5a64e6e into cakephp:master Jul 4, 2022
5 checks passed
@othercorey
Copy link
Member

othercorey commented Jul 4, 2022

I can do a release.

@MasterOdin MasterOdin deleted the patch-1 branch Jul 4, 2022
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

3 participants