Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PropertyInfo] Extract no type param annotation withPhpStanExtractor #59923

Closed
@thomasdubuffet

Description

@thomasdubuffet

Symfony version(s) affected

7.2

Description

AnUndefined property error is issued when a@param annotation has a name without typing (PhpStanExtractor context).

Undefined property: PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode::$type
src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php:219

How to reproduce

class InvalidDummy{/**     * @param $data     */publicfunctionsetData($data)    {    }}

Variable$extractor is an instance ofSymfony\Component\PropertyInfo\Extractor\PhpStanExtractor

$extractor->getType(InvalidDummy::class,'data');

Possible Solution

Update methodgetType inPhpStanExtractor to add a check onTypelessParamTagValueNode

if ($tagDocNode->valueinstanceof InvalidTagValueNode ||$tagDocNode->valueinstanceof TypelessParamTagValueNode) {continue;}if ($tagDocNode->valueinstanceof ParamTagValueNode &&null ===$prefix &&$tagDocNode->value->parameterName !=='$'.$property) {continue;}try {$types[] =$this->stringTypeResolver->resolve((string)$tagDocNode->value->type,$typeContext);}catch (UnsupportedException) {}

Additional Context

No response

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp