@@ -56,8 +56,8 @@ |
||
| 56 | 56 | if(!function_exists('xcache_isset')) |
| 57 | 57 | throw new TConfigurationException('xcache_extension_required'); |
| 58 | 58 | |
| 59 | - $enabled = (int)ini_get('xcache.cacher') !== 0; |
|
| 60 | - $var_size = (int)ini_get('xcache.var_size'); |
|
| 59 | + $enabled = (int) ini_get('xcache.cacher') !== 0; |
|
| 60 | + $var_size = (int) ini_get('xcache.var_size'); |
|
| 61 | 61 | |
| 62 | 62 | if(!($enabled && $var_size > 0)) |
| 63 | 63 | throw new TConfigurationException('xcache_extension_not_enabled'); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | E_USER_NOTICE => "User Notice", |
| 47 | 47 | E_STRICT => "Runtime Notice" |
| 48 | 48 | ]; |
| 49 | - $errorType = isset($errorTypes[$errno])?$errorTypes[$errno]:'Unknown Error'; |
|
| 49 | + $errorType = isset($errorTypes[$errno]) ? $errorTypes[$errno] : 'Unknown Error'; |
|
| 50 | 50 | parent::__construct("[$errorType] $errstr (@line $errline in file $errfile)."); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | */ |
| 175 | 175 | protected function getState($key, $defaultValue = null) |
| 176 | 176 | { |
| 177 | - return isset($this->_state[$key])?$this->_state[$key]:$defaultValue; |
|
| 177 | + return isset($this->_state[$key]) ? $this->_state[$key] : $defaultValue; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | public function isUserAllowed(IUser $user, $verb, $ip) |
| 208 | 208 | { |
| 209 | 209 | if($this->isVerbMatched($verb) && $this->isIpMatched($ip) && $this->isUserMatched($user) && $this->isRoleMatched($user)) |
| 210 | - return ($this->_action === 'allow')?1:-1; |
|
| 210 | + return ($this->_action === 'allow') ? 1 : -1; |
|
| 211 | 211 | else |
| 212 | 212 | return 0; |
| 213 | 213 | } |
@@ -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 | |