1 | <?php |
||
20 | class Argument extends ElementAbstract implements ArgumentInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Argument's name. |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name; |
||
28 | |||
29 | /** |
||
30 | * Argument's default value. |
||
31 | * @var mixed |
||
32 | */ |
||
33 | protected $value; |
||
34 | |||
35 | /** |
||
36 | * Argument's is optional. |
||
37 | * @var bool |
||
38 | */ |
||
39 | protected $isOptional = false; |
||
40 | |||
41 | /** |
||
42 | * Argument's description. |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $description; |
||
46 | |||
47 | /** |
||
48 | * Argument's type. |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $type; |
||
52 | |||
53 | /** |
||
54 | * Primitive types. |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $primitiveTypes = array( |
||
58 | 'bool', 'boolean', |
||
59 | 'decimal', 'double', |
||
60 | 'float', |
||
61 | 'int', 'integer', |
||
62 | 'number', |
||
63 | 'string', |
||
64 | 'resource', |
||
65 | ); |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | 26 | public function init() |
|
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | 21 | public function getName() |
|
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | 16 | public function getNameFormatted() |
|
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | 21 | public function setName($name) |
|
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | 4 | public function getValue() |
|
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | 2 | public function setValue($value) |
|
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | 15 | public function isOptional() |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 26 | public function setIsOptional($isOptional = true) |
|
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | 13 | public function getType() |
|
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | 15 | public function hasType() |
|
155 | |||
156 | /** |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | 8 | public function setType($type) |
|
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | 9 | public function getDescription() |
|
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | 1 | public function setDescription($description) |
|
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | */ |
||
187 | 14 | public function toString() |
|
205 | |||
206 | /** |
||
207 | * Creates Argument from Property Object. |
||
208 | * |
||
209 | * @param PropertyInterface $property |
||
210 | * |
||
211 | * @return Argument |
||
212 | */ |
||
213 | 1 | public static function createFromProperty(PropertyInterface $property) |
|
222 | } |
||
223 |