@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | */ |
| 1120 | 1120 | public function onInitComplete() |
| 1121 | 1121 | { |
| 1122 | - $this->raiseEvent('onInitComplete',$this,null); |
|
| 1122 | + $this->raiseEvent('onInitComplete', $this, null); |
|
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | /** |
@@ -1252,7 +1252,7 @@ discard block |
||
| 1252 | 1252 | public function onEndRequest() |
| 1253 | 1253 | { |
| 1254 | 1254 | $this->flushOutput(false); // flush all remaining content in the buffer |
| 1255 | - $this->saveGlobals(); // save global state |
|
| 1255 | + $this->saveGlobals(); // save global state |
|
| 1256 | 1256 | $this->raiseEvent('OnEndRequest', $this, null); |
| 1257 | 1257 | } |
| 1258 | 1258 | } |
@@ -535,7 +535,7 @@ |
||
| 535 | 535 | */ |
| 536 | 536 | public function onPreRunPage($param) |
| 537 | 537 | { |
| 538 | - $this->raiseEvent('onPreRunPage',$this,$param); |
|
| 538 | + $this->raiseEvent('onPreRunPage', $this, $param); |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | /** |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function __construct($postBackValue) |
| 34 | 34 | { |
| 35 | 35 | $this->_postBackValue = $postBackValue; |
| 36 | - parent::__construct(); |
|
| 36 | + parent::__construct(); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -70,15 +70,15 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | protected function filterItemsForOutput($items) |
| 72 | 72 | { |
| 73 | - if(!self::$_weak) { |
|
| 73 | + if (!self::$_weak) { |
|
| 74 | 74 | return $items; |
| 75 | 75 | } |
| 76 | 76 | $result = []; |
| 77 | - foreach($items as $i => $handler) |
|
| 77 | + foreach ($items as $i => $handler) |
|
| 78 | 78 | { |
| 79 | - if(is_array($handler) && is_object($handler[0]) && is_a($handler[0], '\WeakReference')) { |
|
| 79 | + if (is_array($handler) && is_object($handler[0]) && is_a($handler[0], '\WeakReference')) { |
|
| 80 | 80 | $result[] = [$handler[0]->get(), $handler[1]]; |
| 81 | - } elseif(is_object($handler) && is_a($handler, '\WeakReference')) { |
|
| 81 | + } elseif (is_object($handler) && is_a($handler, '\WeakReference')) { |
|
| 82 | 82 | $result[] = $handler->get(); |
| 83 | 83 | } else |
| 84 | 84 | $result[] = $handler; |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | protected function filterItemForOutput($handler) |
| 97 | 97 | { |
| 98 | - if(!self::$_weak) { |
|
| 98 | + if (!self::$_weak) { |
|
| 99 | 99 | return $handler; |
| 100 | 100 | } |
| 101 | - if(is_array($handler) && is_object($handler[0]) && is_a($handler[0], '\WeakReference')) { |
|
| 101 | + if (is_array($handler) && is_object($handler[0]) && is_a($handler[0], '\WeakReference')) { |
|
| 102 | 102 | return [$handler[0]->get(), $handler[1]]; |
| 103 | - } elseif(is_object($handler) && is_a($handler, '\WeakReference')) { |
|
| 103 | + } elseif (is_object($handler) && is_a($handler, '\WeakReference')) { |
|
| 104 | 104 | return $handler->get(); |
| 105 | 105 | } |
| 106 | 106 | return $handler; |
@@ -112,16 +112,16 @@ discard block |
||
| 112 | 112 | * @param callable $handler callable to convert into a WeakReference version |
| 113 | 113 | * @return mixed callable but with the objects as WeakReferences |
| 114 | 114 | */ |
| 115 | - protected function filterItemForInput($handler, $validate=false) |
|
| 115 | + protected function filterItemForInput($handler, $validate = false) |
|
| 116 | 116 | { |
| 117 | - if($validate && !is_callable($handler,false)) |
|
| 117 | + if ($validate && !is_callable($handler, false)) |
|
| 118 | 118 | throw new TInvalidDataValueException('weakcallablecollection_callable_required'); |
| 119 | - if(!self::$_weak) { |
|
| 119 | + if (!self::$_weak) { |
|
| 120 | 120 | return $handler; |
| 121 | 121 | } |
| 122 | - if(is_array($handler) && is_object($handler[0]) && !is_a($handler[0], '\WeakReference')) { |
|
| 122 | + if (is_array($handler) && is_object($handler[0]) && !is_a($handler[0], '\WeakReference')) { |
|
| 123 | 123 | return [\WeakReference::create($handler[0]), $handler[1]]; |
| 124 | - } elseif(is_object($handler) && !is_a($handler, '\WeakReference')) |
|
| 124 | + } elseif (is_object($handler) && !is_a($handler, '\WeakReference')) |
|
| 125 | 125 | return \WeakReference::create($handler); |
| 126 | 126 | |
| 127 | 127 | return $handler; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function insertAtIndexInPriority($item, $index = false, $priority = null, $preserveCache = false) |
| 202 | 202 | { |
| 203 | - return parent::insertAtIndexInPriority($this->filterItemForInput($item,true), $index, $priority, $preserveCache); |
|
| 203 | + return parent::insertAtIndexInPriority($this->filterItemForInput($item, true), $index, $priority, $preserveCache); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | public function toPriorityArray() |
| 253 | 253 | { |
| 254 | 254 | $result = []; |
| 255 | - foreach(parent::toPriorityArray() as $i => $v) |
|
| 255 | + foreach (parent::toPriorityArray() as $i => $v) |
|
| 256 | 256 | $result[$i] = $this->filterItemsForOutput($v); |
| 257 | 257 | return $result; |
| 258 | 258 | } |
@@ -252,8 +252,9 @@ |
||
| 252 | 252 | public function toPriorityArray() |
| 253 | 253 | { |
| 254 | 254 | $result = []; |
| 255 | - foreach(parent::toPriorityArray() as $i => $v) |
|
| 256 | - $result[$i] = $this->filterItemsForOutput($v); |
|
| 255 | + foreach(parent::toPriorityArray() as $i => $v) { |
|
| 256 | + $result[$i] = $this->filterItemsForOutput($v); |
|
| 257 | + } |
|
| 257 | 258 | return $result; |
| 258 | 259 | } |
| 259 | 260 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | public function onLogin($param) |
| 475 | 475 | { |
| 476 | - $this->raiseEvent('onLogin',$this,$param); |
|
| 476 | + $this->raiseEvent('onLogin', $this, $param); |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | /** |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | */ |
| 483 | 483 | public function onLoginFailed($param) |
| 484 | 484 | { |
| 485 | - $this->raiseEvent('onLoginFailed',$this,$param); |
|
| 485 | + $this->raiseEvent('onLoginFailed', $this, $param); |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | /** |
@@ -491,6 +491,6 @@ discard block |
||
| 491 | 491 | */ |
| 492 | 492 | public function onLogout($param) |
| 493 | 493 | { |
| 494 | - $this->raiseEvent('onLogout',$this,$param); |
|
| 494 | + $this->raiseEvent('onLogout', $this, $param); |
|
| 495 | 495 | } |
| 496 | 496 | } |
@@ -1381,7 +1381,7 @@ |
||
| 1381 | 1381 | } elseif (is_array($behavior) && isset($behavior['class'])) { |
| 1382 | 1382 | $b = Prado::createComponent($behavior['class']); |
| 1383 | 1383 | unset($behavior['class']); |
| 1384 | - foreach($behavior as $property => $value) { |
|
| 1384 | + foreach ($behavior as $property => $value) { |
|
| 1385 | 1385 | $b->setSubProperty($property, $value); |
| 1386 | 1386 | } |
| 1387 | 1387 | $behavior = $b; |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public static function addMessageFile($file) |
| 68 | 68 | { |
| 69 | - if(preg_match('/^(.*)(-.{2.4})?\.(.{2,4})$/', $file, $matching)) |
|
| 69 | + if (preg_match('/^(.*)(-.{2.4})?\.(.{2,4})$/', $file, $matching)) |
|
| 70 | 70 | { |
| 71 | - $lang=Prado::getPreferredLanguage(); |
|
| 72 | - $msgFile=$matching[1].'-'.$lang.'.'.$matching[2]; |
|
| 73 | - if(is_file($msgFile)) |
|
| 74 | - $file=$msgFile; |
|
| 71 | + $lang = Prado::getPreferredLanguage(); |
|
| 72 | + $msgFile = $matching[1] . '-' . $lang . '.' . $matching[2]; |
|
| 73 | + if (is_file($msgFile)) |
|
| 74 | + $file = $msgFile; |
|
| 75 | 75 | } |
| 76 | 76 | TException::$_messagefiles[] = $file; |
| 77 | 77 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $value = $key; |
| 89 | 89 | |
| 90 | 90 | // Cache messages |
| 91 | - foreach($msgFiles as $msgFile) { |
|
| 91 | + foreach ($msgFiles as $msgFile) { |
|
| 92 | 92 | if (!isset(self::$_messageCache[$msgFile])) { |
| 93 | 93 | if (($entries = @file($msgFile)) !== false) { |
| 94 | 94 | foreach ($entries as $entry) { |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | /** |
| 47 | 47 | * This method sets the Owner (TAuthManager) AuthExpire to the Application Parameter of |
| 48 | 48 | * AuthExpireParameter, and the Owner (TAuthManager) AllowAutoLogin to the Application Parameter of |
| 49 | - * AuthExpireParameter. |
|
| 49 | + * AuthExpireParameter. |
|
| 50 | 50 | * @param $owner object the object to which this behavior is being attached |
| 51 | 51 | */ |
| 52 | 52 | public function attach($owner) |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | parent::attach($owner); |
| 55 | 55 | $appParams = Prado::getApplication()->getParameters(); |
| 56 | - if($authExpire = $appParams->itemAt($this->_authExpireParameter)) |
|
| 56 | + if ($authExpire = $appParams->itemAt($this->_authExpireParameter)) |
|
| 57 | 57 | $owner->setAuthExpire($authExpire); |
| 58 | 58 | |
| 59 | 59 | $this->_paramBehavior = new TMapRouteBehavior($this->_authExpireParameter, [$owner, 'setAuthExpire']); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function detach($owner) |
| 68 | 68 | { |
| 69 | - if($this->_paramBehavior) { |
|
| 69 | + if ($this->_paramBehavior) { |
|
| 70 | 70 | Prado::getApplication()->getParameters()->detachBehavior(self::APP_PARAM_AUTH_EXPIRE_BEHAVIOR_NAME); |
| 71 | 71 | } |
| 72 | 72 | parent::detach($owner); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function setPageTitleFromParameter($sender, $param) |
| 55 | 55 | { |
| 56 | - if($title = Prado::getApplication()->getParameters()->itemAt($this->_titleParameter)) |
|
| 56 | + if ($title = Prado::getApplication()->getParameters()->itemAt($this->_titleParameter)) |
|
| 57 | 57 | $this->getOwner()->setTitle($title); |
| 58 | 58 | } |
| 59 | 59 | |