Skip to content

Commit

Permalink
Unified builder methods for setting types
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich authored and nikic committed Sep 14, 2021
1 parent a45fb2a commit 0a20979
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/PhpParser/Builder/FunctionLike.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public function addParams(array $params) {
/**
* Sets the return type for PHP 7.
*
* @param string|Node\Name|Node\NullableType $type One of array, callable, string, int, float,
* bool, iterable, or a class/interface name.
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type
*
* @return $this The builder instance (for fluid interface)
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/PhpParser/Builder/Param.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function setDefault($value) {
/**
* Sets type for the parameter.
*
* @param string|Node\Name|Node\ComplexType $type Parameter type
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
*
* @return $this The builder instance (for fluid interface)
*/
Expand All @@ -63,7 +63,7 @@ public function setType($type) {
/**
* Sets type for the parameter.
*
* @param string|Node\Name|Node\ComplexType $type Parameter type
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
*
* @return $this The builder instance (for fluid interface)
*
Expand Down
4 changes: 2 additions & 2 deletions lib/PhpParser/Builder/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Stmt;
use PhpParser\Node\ComplexType;

class Property implements PhpParser\Builder
{
Expand Down Expand Up @@ -119,7 +119,7 @@ public function setDocComment($docComment) {
/**
* Sets the property type for PHP 7.4+.
*
* @param string|Name|NullableType|Identifier $type
* @param string|Name|Identifier|ComplexType $type
*
* @return $this
*/
Expand Down
1 change: 0 additions & 1 deletion lib/PhpParser/BuilderHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PhpParser\Node\ComplexType;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\IntersectionType;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Scalar;
Expand Down

0 comments on commit 0a20979

Please sign in to comment.