Skip to content

Navigation Menu

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

Appearance settings

Commit f5e493d

Browse filesBrowse files
fix: extract no type @param annotation with PhpStanExtractor
1 parent 653e42d commit f5e493d
Copy full SHA for f5e493d

File tree

3 files changed

+11
-1
lines changed
Filter options

3 files changed

+11
-1
lines changed

‎src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php
+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
1717
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode;
1818
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
19+
use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode;
1920
use PHPStan\PhpDocParser\Lexer\Lexer;
2021
use PHPStan\PhpDocParser\Parser\ConstExprParser;
2122
use PHPStan\PhpDocParser\Parser\PhpDocParser;
@@ -206,7 +207,7 @@ public function getType(string $class, string $property, array $context = []): ?
206207
$types = [];
207208

208209
foreach ($docNode->getTagsByName($tag) as $tagDocNode) {
209-
if ($tagDocNode->value instanceof InvalidTagValueNode) {
210+
if ($tagDocNode->value instanceof InvalidTagValueNode || $tagDocNode->value instanceof TypelessParamTagValueNode) {
210211
continue;
211212
}
212213

‎src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php
+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public static function provideLegacyInvalidTypes()
8282
'stat' => ['stat'],
8383
'foo' => ['foo'],
8484
'bar' => ['bar'],
85+
'data' => ['data'],
8586
];
8687
}
8788

@@ -694,6 +695,7 @@ public static function invalidTypesProvider(): iterable
694695
yield 'stat' => ['stat'];
695696
yield 'foo' => ['foo'];
696697
yield 'bar' => ['bar'];
698+
yield 'data' => ['data'];
697699
}
698700

699701
/**

‎src/Symfony/Component/PropertyInfo/Tests/Fixtures/InvalidDummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Fixtures/InvalidDummy.php
+7
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,11 @@ public function getBar()
4747
{
4848
return 'bar';
4949
}
50+
51+
/**
52+
* @param $data
53+
*/
54+
public function setData($data)
55+
{
56+
}
5057
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.