Skip to content

Incompatible with phpstan/phpdoc-parser >= 1.6 #1379

@martijnc

Description

@martijnc

phpstan/[email protected] introduced PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode in phpstan/phpdoc-parser@9d45205 which it returns instead of PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode for docblock @param definitions without a type.

Slevomat typehints ParamTagValueNode in ParameterAnnotation::__construct(), but as of [email protected] this can also be TypelessParamTagValueNode resulting in the following error when PHPCS encounters a docblock with a typeless @param.

Fatal error: Uncaught TypeError: SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation::__construct(): Argument #5 ($contentNode) must be of type ?PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode, PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode given, called in /Volumes/Projects/mortar/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php on line 357 and defined in /Volumes/Projects/mortar/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php:31

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions