@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected function setDefaultPriority($value) |
141 | 141 | { |
142 | - $this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p); |
|
142 | + $this->_dp = (string) round(TPropertyValue::ensureFloat($value), $this->_p); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | { |
224 | 224 | if($priority === null) |
225 | 225 | $priority = $this->getDefaultPriority(); |
226 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
226 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
227 | 227 | |
228 | 228 | if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority])) |
229 | 229 | return false; |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function itemAt($key, $priority = false) |
261 | 261 | { |
262 | - if($priority === false){ |
|
262 | + if($priority === false) { |
|
263 | 263 | $map = $this->flattenPriorities(); |
264 | - return isset($map[$key])?$map[$key]:null; |
|
264 | + return isset($map[$key]) ? $map[$key] : null; |
|
265 | 265 | } else { |
266 | 266 | if($priority === null) |
267 | 267 | $priority = $this->getDefaultPriority(); |
268 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
269 | - return (isset($this->_d[$priority]) && isset($this->_d[$priority][$key]))?$this->_d[$priority][$key]:null; |
|
268 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
269 | + return (isset($this->_d[$priority]) && isset($this->_d[$priority][$key])) ? $this->_d[$priority][$key] : null; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | { |
282 | 282 | if($priority === null) |
283 | 283 | $priority = $this->getDefaultPriority(); |
284 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
284 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
285 | 285 | |
286 | 286 | $oldpriority = $this->priorityAt($key); |
287 | 287 | if($oldpriority !== false && $oldpriority != $priority) { |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | { |
301 | 301 | if($priority === null) |
302 | 302 | $priority = $this->getDefaultPriority(); |
303 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
303 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
304 | 304 | |
305 | - return isset($this->_d[$priority])?$this->_d[$priority]:null; |
|
305 | + return isset($this->_d[$priority]) ? $this->_d[$priority] : null; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | { |
351 | 351 | if($priority === null) |
352 | 352 | $priority = $this->getDefaultPriority(); |
353 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
353 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
354 | 354 | |
355 | 355 | if(!$this->_r) |
356 | 356 | { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | else |
418 | 418 | { |
419 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
419 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
420 | 420 | if(isset($this->_d[$priority]) && (isset($this->_d[$priority][$key]) || array_key_exists($key, $this->_d[$priority]))) |
421 | 421 | { |
422 | 422 | $value = $this->_d[$priority][$key]; |
@@ -206,7 +206,7 @@ |
||
206 | 206 | $count = $this->getDataSourceCount(); |
207 | 207 | if(!$this->_allowPaging || $count <= 0) |
208 | 208 | return 1; |
209 | - return (int)(($count + $this->_pageSize - 1) / $this->_pageSize); |
|
209 | + return (int) (($count + $this->_pageSize - 1) / $this->_pageSize); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | if($priority === null) |
128 | 128 | $priority = $this->getDefaultPriority(); |
129 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
129 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
130 | 130 | |
131 | 131 | if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority])) |
132 | 132 | return false; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | protected function setDefaultPriority($value) |
149 | 149 | { |
150 | - $this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p); |
|
150 | + $this->_dp = (string) round(TPropertyValue::ensureFloat($value), $this->_p); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -239,9 +239,9 @@ discard block |
||
239 | 239 | { |
240 | 240 | if($priority === null) |
241 | 241 | $priority = $this->getDefaultPriority(); |
242 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
242 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
243 | 243 | |
244 | - return isset($this->_d[$priority])?$this->_d[$priority]:null; |
|
244 | + return isset($this->_d[$priority]) ? $this->_d[$priority] : null; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | { |
255 | 255 | if($priority === null) |
256 | 256 | $priority = $this->getDefaultPriority(); |
257 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
257 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
258 | 258 | |
259 | - return !isset($this->_d[$priority])?false:( |
|
260 | - isset($this->_d[$priority][$index])?$this->_d[$priority][$index]:false |
|
259 | + return !isset($this->_d[$priority]) ?false:( |
|
260 | + isset($this->_d[$priority][$index]) ? $this->_d[$priority][$index] : false |
|
261 | 261 | ); |
262 | 262 | } |
263 | 263 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | |
314 | 314 | if($priority === null) |
315 | 315 | $priority = $this->getDefaultPriority(); |
316 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
316 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
317 | 317 | |
318 | 318 | if($preserveCache) { |
319 | 319 | $this->sortPriorities(); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | if($priority !== false) { |
385 | 385 | if($priority === null) |
386 | 386 | $priority = $this->getDefaultPriority(); |
387 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
387 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
388 | 388 | |
389 | 389 | if($p[0] != $priority) |
390 | 390 | throw new TInvalidDataValueException('list_item_inexistent'); |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | if($priority === null) |
430 | 430 | $priority = $this->getDefaultPriority(); |
431 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
431 | + $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
432 | 432 | |
433 | 433 | if(!isset($this->_d[$priority]) || $index < 0 || $index >= count($this->_d[$priority])) |
434 | 434 | throw new TInvalidDataValueException('list_item_inexistent'); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
455 | 455 | |
456 | 456 | foreach($this->_d as $priority => $items) { |
457 | - for($index = count($items) - 1;$index >= 0;$index--) |
|
457 | + for($index = count($items) - 1; $index >= 0; $index--) |
|
458 | 458 | $this->removeAtIndexInPriority($index, $priority); |
459 | 459 | unset($this->_d[$priority]); |
460 | 460 | } |
@@ -498,8 +498,8 @@ discard block |
||
498 | 498 | foreach($this->_d as $priority => $items) { |
499 | 499 | if(($index = array_search($item, $items, true)) !== false) { |
500 | 500 | $absindex += $index; |
501 | - return $withindex?[$priority,$index,$absindex, |
|
502 | - 'priority' => $priority,'index' => $index,'absindex' => $absindex]:$priority; |
|
501 | + return $withindex ? [$priority, $index, $absindex, |
|
502 | + 'priority' => $priority, 'index' => $index, 'absindex' => $absindex] : $priority; |
|
503 | 503 | } else |
504 | 504 | $absindex += count($items); |
505 | 505 | } |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | if($index >= ($c = count($items))) |
528 | 528 | $index -= $c; |
529 | 529 | else |
530 | - return $withindex?[$priority,$index,$absindex, |
|
531 | - 'priority' => $priority,'index' => $index,'absindex' => $absindex]:$priority; |
|
530 | + return $withindex ? [$priority, $index, $absindex, |
|
531 | + 'priority' => $priority, 'index' => $index, 'absindex' => $absindex] : $priority; |
|
532 | 532 | } |
533 | 533 | return false; |
534 | 534 | } |
@@ -231,7 +231,7 @@ |
||
231 | 231 | */ |
232 | 232 | public function clear() |
233 | 233 | { |
234 | - for($i = $this->_c - 1;$i >= 0;--$i) |
|
234 | + for($i = $this->_c - 1; $i >= 0; --$i) |
|
235 | 235 | $this->removeAt($i); |
236 | 236 | } |
237 | 237 |
@@ -57,9 +57,9 @@ |
||
57 | 57 | protected function _getZappableSleepProps(&$exprops) |
58 | 58 | { |
59 | 59 | parent::_getZappableSleepProps($exprops); |
60 | - if ($this->_d === []) |
|
60 | + if($this->_d === []) |
|
61 | 61 | $exprops[] = "\0Prado\Collections\TMap\0_d"; |
62 | - if ($this->_r === false) |
|
62 | + if($this->_r === false) |
|
63 | 63 | $exprops[] = "\0Prado\Collections\TMap\0_r"; |
64 | 64 | } |
65 | 65 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | public function rewind() |
55 | 55 | { |
56 | 56 | $this->_iterator->rewind(); |
57 | - for($i = 0;$i < $this->_startIndex;++$i) |
|
57 | + for($i = 0; $i < $this->_startIndex; ++$i) |
|
58 | 58 | $this->_iterator->next(); |
59 | 59 | $this->_index = 0; |
60 | 60 | } |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | if($this->_customPaging) |
251 | 251 | { |
252 | 252 | if($this->_virtualCount >= 0) |
253 | - return (int)(($this->_virtualCount + $this->_pageSize - 1) / $this->_pageSize); |
|
253 | + return (int) (($this->_virtualCount + $this->_pageSize - 1) / $this->_pageSize); |
|
254 | 254 | else |
255 | 255 | return -1; |
256 | 256 | } |
257 | 257 | else |
258 | - return (int)((parent::getCount() + $this->_pageSize - 1) / $this->_pageSize); |
|
258 | + return (int) ((parent::getCount() + $this->_pageSize - 1) / $this->_pageSize); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | public function indexOf($item) |
327 | 327 | { |
328 | 328 | $c = $this->getCount(); |
329 | - for($i = 0;$i < $c;++$i) |
|
329 | + for($i = 0; $i < $c; ++$i) |
|
330 | 330 | if($this->itemAt($i) === $item) |
331 | 331 | return $i; |
332 | 332 | return -1; |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | { |
363 | 363 | $c = $this->getCount(); |
364 | 364 | $array = []; |
365 | - for($i = 0;$i < $c;++$i) |
|
365 | + for($i = 0; $i < $c; ++$i) |
|
366 | 366 | $array[$i] = $this->itemAt($i); |
367 | 367 | return $array; |
368 | 368 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | protected function _getZappableSleepProps(&$exprops) |
53 | 53 | { |
54 | 54 | parent::_getZappableSleepProps($exprops); |
55 | - if ($this->_caseSensitive === false) |
|
55 | + if($this->_caseSensitive === false) |
|
56 | 56 | $exprops[] = "\0Prado\Collections\TAttributeCollection\0_caseSensitive"; |
57 | 57 | } |
58 | 58 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function __get($name) |
68 | 68 | { |
69 | - return $this->contains($name)?$this->itemAt($name):parent::__get($name); |
|
69 | + return $this->contains($name) ? $this->itemAt($name) : parent::__get($name); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function itemAt($key) |
108 | 108 | { |
109 | - return parent::itemAt($this->_caseSensitive?$key:strtolower($key)); |
|
109 | + return parent::itemAt($this->_caseSensitive ? $key : strtolower($key)); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function add($key, $value) |
120 | 120 | { |
121 | - parent::add($this->_caseSensitive?$key:strtolower($key), $value); |
|
121 | + parent::add($this->_caseSensitive ? $key : strtolower($key), $value); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function remove($key) |
131 | 131 | { |
132 | - return parent::remove($this->_caseSensitive?$key:strtolower($key)); |
|
132 | + return parent::remove($this->_caseSensitive ? $key : strtolower($key)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function contains($key) |
142 | 142 | { |
143 | - return parent::contains($this->_caseSensitive?$key:strtolower($key)); |
|
143 | + return parent::contains($this->_caseSensitive ? $key : strtolower($key)); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -119,7 +119,7 @@ |
||
119 | 119 | { |
120 | 120 | $feed = Prado::createComponent($feedConfig['class']); |
121 | 121 | if($service instanceof IFeedContentProvider) |
122 | - $properties = isset($feedConfig['properties'])?$feedConfig['properties']:[]; |
|
122 | + $properties = isset($feedConfig['properties']) ? $feedConfig['properties'] : []; |
|
123 | 123 | else |
124 | 124 | throw new TConfigurationException('jsonservice_response_type_invalid', $id); |
125 | 125 | } |