Skip to content

phpcs error on rule classes - must be of the type integer #20186

Closed
@ipascual

Description

@ipascual

Preconditions (*)

  1. You need code under app/code

Steps to reproduce (*)

  1. ./vendor/bin/phpcs --standard=./dev/tests/static/framework/Magento/ app/code/

Expected result (*)

  1. phpcs should report in the terminal all errors and warnings.

Actual result (*)

  1. Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Sniffs\Annotation\ClassAnnotationStructureSniff::validateAnnotationBlockExists() must be of the type integer, boolean given, called in /var/www/magento2/dev/tests/static/framework/Magento/Sniffs/Annotation/ClassAnnotationStructureSniff.php on line 100 and defined in /var/www/magento2/dev/tests/static/framework/Magento/Sniffs/Annotation/ClassAnnotationStructureSniff.php:76

Solution

For some reason, the functions are using Variable Typing for integers, however some scenarios is sending boolean. I fixed my local removing the variable typing of any "int" in method signature.

Metadata

Metadata

Assignees

Labels

Component: StaticTestFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions