8000 Replace tags by phpDocumentor\Reflection\Type · symfony/symfony@5986436 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5986436

Browse files
committed
Replace tags by phpDocumentor\Reflection\Type
1 parent 3d57310 commit 5986436

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getTypes($class, $property, array $context = array())
128128
$types = array();
129129
/** @var DocBlock\Tags\Var_|DocBlock\Tags\Return_|DocBlock\Tags\Param $tag */
130130
foreach ($docBlock->getTagsByName($tag) as $tag) {
131-
$types = array_merge($types, $this->phpDocTypeHelper->getTypesFromTag($tag));
131+
$types = array_merge($types, $this->phpDocTypeHelper->getTypes($tag->getType()));
132132
}
133133

134134
if (!isset($types[0])) {

src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Symfony\Component\PropertyInfo\Util;
1313

14-
use phpDocumentor\Reflection\DocBlock\Tags\Param;
15-
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
16-
use phpDocumentor\Reflection\DocBlock\Tags\Var_;
14+
use phpDocumentor\Reflection\Type as DocType;
1715
use phpDocumentor\Reflection\Types\Compound;
1816
use phpDocumentor\Reflection\Types\Null_;
1917
use Symfony\Component\PropertyInfo\Type;
@@ -27,16 +25,13 @@
2725
final class PhpDocTypeHelper
2826
{
2927
/**
30-
* Creates a {@see Type} from a PHPDoc tag.
31-
*
32-
* @param Var_|Return_|Param $tag
28+
* Creates a {@see Type} from a PHPDoc type.
3329
*
3430
* @return Type
3531
*/
36-
public function getTypesFromTag($tag)
32+
public function getTypes(DocType $varType)
3733
{
3834
$types = array();
39-
$varType = $tag->getType();
4035
$nullable = false;
4136

4237
if (!$varType instanceof Compound) {

0 commit comments

Comments
 (0)
0