Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
12:7a779792577d | 13:5fb285c0d0e3 |
---|---|
1 <?php | 1 <?php declare(strict_types=1); |
2 | 2 |
3 namespace PhpParser\Builder; | 3 namespace PhpParser\Builder; |
4 | 4 |
5 use PhpParser; | 5 use PhpParser\BuilderHelpers; |
6 use PhpParser\Node; | 6 use PhpParser\Node; |
7 | 7 |
8 abstract class FunctionLike extends Declaration | 8 abstract class FunctionLike extends Declaration |
9 { | 9 { |
10 protected $returnByRef = false; | 10 protected $returnByRef = false; |
11 protected $params = array(); | 11 protected $params = []; |
12 | 12 |
13 /** @var string|Node\Name|Node\NullableType|null */ | 13 /** @var string|Node\Name|Node\NullableType|null */ |
14 protected $returnType = null; | 14 protected $returnType = null; |
15 | 15 |
16 /** | 16 /** |
30 * @param Node\Param|Param $param The parameter to add | 30 * @param Node\Param|Param $param The parameter to add |
31 * | 31 * |
32 * @return $this The builder instance (for fluid interface) | 32 * @return $this The builder instance (for fluid interface) |
33 */ | 33 */ |
34 public function addParam($param) { | 34 public function addParam($param) { |
35 $param = $this->normalizeNode($param); | 35 $param = BuilderHelpers::normalizeNode($param); |
36 | 36 |
37 if (!$param instanceof Node\Param) { | 37 if (!$param instanceof Node\Param) { |
38 throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); | 38 throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); |
39 } | 39 } |
40 | 40 |
59 } | 59 } |
60 | 60 |
61 /** | 61 /** |
62 * Sets the return type for PHP 7. | 62 * Sets the return type for PHP 7. |
63 * | 63 * |
64 * @param string|Node\Name|Node\NullableType $type One of array, callable, string, int, float, bool, iterable, | 64 * @param string|Node\Name|Node\NullableType $type One of array, callable, string, int, float, |
65 * or a class/interface name. | 65 * bool, iterable, or a class/interface name. |
66 * | 66 * |
67 * @return $this The builder instance (for fluid interface) | 67 * @return $this The builder instance (for fluid interface) |
68 */ | 68 */ |
69 public function setReturnType($type) | 69 public function setReturnType($type) { |
70 { | 70 $this->returnType = BuilderHelpers::normalizeType($type); |
71 $this->returnType = $this->normalizeType($type); | |
72 | 71 |
73 return $this; | 72 return $this; |
74 } | 73 } |
75 } | 74 } |