1 | <?php |
||
31 | class PhpParameter extends AbstractModel implements ValueInterface { |
||
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 | 19 | public static function create($name = null) { |
|
48 | |||
49 | /** |
||
50 | * Creates a PHP parameter from reflection |
||
51 | * |
||
52 | * @deprecated will be removed in version 0.5 |
||
53 | * @param \ReflectionParameter $ref |
||
54 | * @return PhpParameter |
||
55 | */ |
||
56 | 2 | public static function fromReflection(\ReflectionParameter $ref) { |
|
100 | |||
101 | /** |
||
102 | * Creates a new PHP parameter |
||
103 | * |
||
104 | * @param string $name the parameter name |
||
105 | */ |
||
106 | 32 | public function __construct($name = null) { |
|
109 | |||
110 | /** |
||
111 | * Sets whether this parameter is passed by reference |
||
112 | * |
||
113 | * @param bool $bool `true` if passed by reference and `false` if not |
||
114 | * @return $this |
||
115 | */ |
||
116 | 12 | public function setPassedByReference($bool) { |
|
121 | |||
122 | /** |
||
123 | * Returns whether this parameter is passed by reference |
||
124 | * |
||
125 | * @return bool `true` if passed by reference and `false` if not |
||
126 | */ |
||
127 | 12 | public function isPassedByReference() { |
|
130 | |||
131 | /** |
||
132 | * Returns a docblock tag for this parameter |
||
133 | * |
||
134 | * @return ParamTag |
||
135 | */ |
||
136 | 7 | public function getDocblockTag() { |
|
142 | |||
143 | /** |
||
144 | * Alias for setDescription() |
||
145 | * |
||
146 | * @see #setDescription |
||
147 | * @param string $description |
||
148 | * @return $this |
||
149 | */ |
||
150 | 7 | public function setTypeDescription($description) { |
|
153 | |||
154 | /** |
||
155 | * Alias for getDescription() |
||
156 | * |
||
157 | * @see #getDescription |
||
158 | * @return string |
||
159 | */ |
||
160 | 9 | public function getTypeDescription() { |
|
163 | } |
||
164 |