Skip to content

Commit 4a98afe

Browse files
committed
Fix docblock union types
1 parent 3b63336 commit 4a98afe

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/DefinitionResolver.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getDeclarationLineFromNode($node): string
5454
{
5555
// If node is part of a declaration list, build a declaration line that discludes other elements in the list
5656
// - [PropertyDeclaration] // public $a, [$b = 3], $c; => public $b = 3;
57-
// - [ConstDeclaration | ClassConstDeclaration] // "const A = 3, [B = 4];" => "const B = 4;"
57+
// - [ConstDeclaration|ClassConstDeclaration] // "const A = 3, [B = 4];" => "const B = 4;"
5858
if (
5959
($declaration = ParserHelpers\tryGetPropertyDeclaration($node)) && ($elements = $declaration->propertyElements) ||
6060
($declaration = ParserHelpers\tryGetConstOrClassConstDeclaration($node)) && ($elements = $declaration->constElements)
@@ -131,7 +131,7 @@ public function getDocumentationFromNode($node)
131131
* Gets Doc Block with resolved names for a Node
132132
*
133133
* @param Node $node
134-
* @return DocBlock | null
134+
* @return DocBlock|null
135135
*/
136136
private function getDocBlock(Node $node)
137137
{
@@ -482,8 +482,8 @@ private static function getContainingClassFqn(Node $node)
482482
/**
483483
* Returns the assignment or parameter node where a variable was defined
484484
*
485-
* @param Node\Expression\Variable | Node\Expression\ClosureUse $var The variable access
486-
* @return Node\Expression\Assign | Node\Expression\AssignOp|Node\Param | Node\Expression\ClosureUse|null
485+
* @param Node\Expression\Variable|Node\Expression\ClosureUse $var The variable access
486+
* @return Node\Expression\Assign|Node\Expression\AssignOp|Node\Param|Node\Expression\ClosureUse|null
487487
*/
488488
public function resolveVariableToNode($var)
489489
{
@@ -894,7 +894,7 @@ public function resolveExpressionNodeToType($expr)
894894
* Takes any class name node (from a static method call, or new node) and returns a Type object
895895
* Resolves keywords like self, static and parent
896896
*
897-
* @param Node | PhpParser\Token $class
897+
* @param Node|PhpParser\Token $class
898898
* @return Type
899899
*/
900900
public function resolveClassNameToType($class): Type
@@ -1191,9 +1191,9 @@ public static function getDefinedFqn($node)
11911191
}
11921192

11931193
/**
1194-
* @param DocBlock | null $docBlock
1195-
* @param string | null $variableName
1196-
* @return DocBlock\Tags\Param | null
1194+
* @param DocBlock|null $docBlock
1195+
* @param string|null $variableName
1196+
* @return DocBlock\Tags\Param|null
11971197
*/
11981198
private function tryGetDocBlockTagForParameter($docBlock, $variableName)
11991199
{

src/ParserHelpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function isBooleanExpression($expression) : bool
7777
/**
7878
* Tries to get the parent property declaration given a Node
7979
* @param Node $node
80-
* @return Node\PropertyDeclaration | null $node
80+
* @return Node\PropertyDeclaration|null $node
8181
*/
8282
function tryGetPropertyDeclaration(Node $node)
8383
{
@@ -93,7 +93,7 @@ function tryGetPropertyDeclaration(Node $node)
9393
/**
9494
* Tries to get the parent ConstDeclaration or ClassConstDeclaration given a Node
9595
* @param Node $node
96-
* @return Node\Statement\ConstDeclaration | Node\ClassConstDeclaration | null $node
96+
* @return Node\Statement\ConstDeclaration|Node\ClassConstDeclaration|null $node
9797
*/
9898
function tryGetConstOrClassConstDeclaration(Node $node)
9999
{

0 commit comments

Comments
 (0)