1 | <?php |
||
31 | class PhpParameter extends AbstractModel { |
||
32 | |||
33 | use NamePart; |
||
34 | use TypePart; |
||
35 | use ValuePart; |
||
36 | |||
37 | private $passedByReference = false; |
||
38 | |||
39 | /** |
||
40 | * Creates a new PHP parameter. |
||
41 | * |
||
42 | * @param string $name the parameter name |
||
43 | * @return static |
||
44 | */ |
||
45 | 16 | public static function create($name = null) { |
|
48 | |||
49 | /** |
||
50 | * Creates a PHP parameter from reflection |
||
51 | * |
||
52 | * @param \ReflectionParameter $ref |
||
53 | * @return PhpParameter |
||
54 | */ |
||
55 | 4 | public static function fromReflection(\ReflectionParameter $ref) { |
|
93 | |||
94 | /** |
||
95 | * Creates a new PHP parameter |
||
96 | * |
||
97 | * @param string $name the parameter name |
||
98 | */ |
||
99 | 27 | public function __construct($name = null) { |
|
102 | |||
103 | /** |
||
104 | * Sets whether this parameter is passed by reference |
||
105 | * |
||
106 | * @param bool $bool `true` if passed by reference and `false` if not |
||
107 | * @return $this |
||
108 | */ |
||
109 | 6 | public function setPassedByReference($bool) { |
|
114 | |||
115 | /** |
||
116 | * Returns whether this parameter is passed by reference |
||
117 | * |
||
118 | * @return bool `true` if passed by reference and `false` if not |
||
119 | */ |
||
120 | 12 | public function isPassedByReference() { |
|
123 | |||
124 | /** |
||
125 | * Returns a docblock tag for this parameter |
||
126 | * |
||
127 | * @return ParamTag |
||
128 | */ |
||
129 | 7 | public function getDocblockTag() { |
|
135 | |||
136 | /** |
||
137 | * Alias for setDescription() |
||
138 | * |
||
139 | * @see #setDescription |
||
140 | * @param string $description |
||
141 | * @return $this |
||
142 | */ |
||
143 | 7 | public function setTypeDescription($description) { |
|
146 | |||
147 | /** |
||
148 | * Alias for getDescription() |
||
149 | * |
||
150 | * @see #getDescription |
||
151 | * @return string |
||
152 | */ |
||
153 | 8 | public function getTypeDescription() { |
|
156 | } |
||
157 |