comparison vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
40 40
41 return $this; 41 return $this;
42 } 42 }
43 43
44 /** 44 /**
45 * Sets type hint for the parameter. 45 * Sets type for the parameter.
46 * 46 *
47 * @param string|Node\Name|Node\NullableType $type Type hint to use 47 * @param string|Node\Name|Node\NullableType $type Parameter type
48 * 48 *
49 * @return $this The builder instance (for fluid interface) 49 * @return $this The builder instance (for fluid interface)
50 */ 50 */
51 public function setTypeHint($type) { 51 public function setType($type) {
52 $this->type = BuilderHelpers::normalizeType($type); 52 $this->type = BuilderHelpers::normalizeType($type);
53 if ($this->type == 'void') { 53 if ($this->type == 'void') {
54 throw new \LogicException('Parameter type cannot be void'); 54 throw new \LogicException('Parameter type cannot be void');
55 } 55 }
56 56
57 return $this; 57 return $this;
58 }
59
60 /**
61 * Sets type for the parameter.
62 *
63 * @param string|Node\Name|Node\NullableType $type Parameter type
64 *
65 * @return $this The builder instance (for fluid interface)
66 *
67 * @deprecated Use setType() instead
68 */
69 public function setTypeHint($type) {
70 return $this->setType($type);
58 } 71 }
59 72
60 /** 73 /**
61 * Make the parameter accept the value by reference. 74 * Make the parameter accept the value by reference.
62 * 75 *