1 | <?php |
||
8 | class Field |
||
9 | { |
||
10 | const VALUE_STRING = 'fvalueString'; |
||
11 | const VALUE_INT = 'fvalueInt'; |
||
12 | const VALUE_FLOAT = 'fvalueFloat'; |
||
13 | const VALUE_IMAGE = 'fvalueImage'; |
||
14 | const VALUE_DATETIME = 'fvalueDatetime'; |
||
15 | const VALUE_DATE = 'fvalueDate'; |
||
16 | const VALUE_RANGE_INT = 'fvalueRangeInt'; |
||
17 | const VALUE_RANGE_FLOAT = 'fvalueRangeFloat'; |
||
18 | const VALUE_RANGE_DATE = 'fvalueRangeDate'; |
||
19 | |||
20 | const DEFAULT_STRING = ''; |
||
21 | const DEFAULT_INT = 0; |
||
22 | const DEFAULT_FLOAT = 0; |
||
23 | const DEFAULT_IMAGE = ''; |
||
24 | const DEFAULT_DATETIME = 0; |
||
25 | const DEFAULT_DATE = ''; |
||
26 | |||
27 | /** |
||
28 | * Allegro WebAPI fid |
||
29 | * @var integer |
||
30 | */ |
||
31 | protected $fid = null; |
||
32 | |||
33 | protected $fValues = []; |
||
34 | |||
35 | |||
36 | /** |
||
37 | * @param integer $fid WebAPI fid for given field |
||
38 | * @param mixed $value value for given field |
||
39 | * @param string $forceValueType value type to force (i.e. fvalueImage) |
||
40 | */ |
||
41 | 16 | public function __construct($fid = 0, $value = null, $forceValueType = '') |
|
60 | |||
61 | /** |
||
62 | * Default values, "empty" WebAPI fields item |
||
63 | * @return array |
||
64 | */ |
||
65 | 15 | protected function getDefaults() |
|
88 | |||
89 | |||
90 | 16 | public function setFid($fid) |
|
97 | |||
98 | |||
99 | 9 | protected function setValueAutodetect($value) |
|
113 | |||
114 | |||
115 | /** |
||
116 | * Detect type of string value (date or normal string) |
||
117 | * @param string $value value to detect type |
||
118 | */ |
||
119 | 4 | protected function setValueStringAutodetect($value) |
|
127 | |||
128 | /** |
||
129 | * Detect type of range passed as argument (int, float, date) |
||
130 | * @param array $value value to detect type |
||
|
|||
131 | */ |
||
132 | 2 | protected function setValueRangeAutodetect(array $range) |
|
155 | |||
156 | |||
157 | /** |
||
158 | * Checks if given range is float |
||
159 | * @param array $range range to check |
||
160 | * @return boolean |
||
161 | */ |
||
162 | 2 | protected function isRangeFloat(array $range) |
|
167 | |||
168 | |||
169 | /** |
||
170 | * Checks if given range is int |
||
171 | * @param array $range range to check |
||
172 | * @return boolean |
||
173 | */ |
||
174 | 1 | protected function isRangeInt(array $range) |
|
179 | |||
180 | |||
181 | 2 | protected function setValueForced($forceValueType, $value) |
|
189 | |||
190 | |||
191 | /** |
||
192 | * Returns WebAPI representation of Field |
||
193 | * @return array field |
||
194 | */ |
||
195 | 8 | public function toArray() |
|
200 | |||
201 | |||
202 | /** |
||
203 | * Creates object from WebAPI representation of Field |
||
204 | */ |
||
205 | 4 | public function fromArray(array $array) |
|
225 | |||
226 | |||
227 | 5 | public function getFid() |
|
231 | |||
232 | |||
233 | /** |
||
234 | * Return first property that is different from its default value |
||
235 | * @return mixed | null |
||
236 | */ |
||
237 | 11 | public function getValue() |
|
251 | |||
252 | |||
253 | } |
||
254 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.