Skip to content

Commit 0a20979

Browse files
kukulichnikic
authored andcommitted
Unified builder methods for setting types
1 parent a45fb2a commit 0a20979

4 files changed

Lines changed: 5 additions & 7 deletions

File tree

lib/PhpParser/Builder/FunctionLike.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public function addParams(array $params) {
6161
/**
6262
* Sets the return type for PHP 7.
6363
*
64-
* @param string|Node\Name|Node\NullableType $type One of array, callable, string, int, float,
65-
* bool, iterable, or a class/interface name.
64+
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type
6665
*
6766
* @return $this The builder instance (for fluid interface)
6867
*/

lib/PhpParser/Builder/Param.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function setDefault($value) {
4747
/**
4848
* Sets type for the parameter.
4949
*
50-
* @param string|Node\Name|Node\ComplexType $type Parameter type
50+
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
5151
*
5252
* @return $this The builder instance (for fluid interface)
5353
*/
@@ -63,7 +63,7 @@ public function setType($type) {
6363
/**
6464
* Sets type for the parameter.
6565
*
66-
* @param string|Node\Name|Node\ComplexType $type Parameter type
66+
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
6767
*
6868
* @return $this The builder instance (for fluid interface)
6969
*

lib/PhpParser/Builder/Property.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use PhpParser\Node;
88
use PhpParser\Node\Identifier;
99
use PhpParser\Node\Name;
10-
use PhpParser\Node\NullableType;
1110
use PhpParser\Node\Stmt;
11+
use PhpParser\Node\ComplexType;
1212

1313
class Property implements PhpParser\Builder
1414
{
@@ -119,7 +119,7 @@ public function setDocComment($docComment) {
119119
/**
120120
* Sets the property type for PHP 7.4+.
121121
*
122-
* @param string|Name|NullableType|Identifier $type
122+
* @param string|Name|Identifier|ComplexType $type
123123
*
124124
* @return $this
125125
*/

lib/PhpParser/BuilderHelpers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PhpParser\Node\ComplexType;
66
use PhpParser\Node\Expr;
77
use PhpParser\Node\Identifier;
8-
use PhpParser\Node\IntersectionType;
98
use PhpParser\Node\Name;
109
use PhpParser\Node\NullableType;
1110
use PhpParser\Node\Scalar;

0 commit comments

Comments
 (0)