@@ -104,8 +104,7 @@ |
||
| 104 | 104 | $this->_query = isset($ret['query'])?$ret['query']:''; |
| 105 | 105 | $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
| 106 | 106 | $this->_uri = $uri; |
| 107 | - } |
|
| 108 | - else |
|
| 107 | + } else |
|
| 109 | 108 | { |
| 110 | 109 | throw new TInvalidDataValueException('uri_format_invalid', $uri); |
| 111 | 110 | } |
@@ -92,17 +92,17 @@ |
||
| 92 | 92 | */ |
| 93 | 93 | public function __construct($uri) |
| 94 | 94 | { |
| 95 | - if(($ret = @parse_url($uri)) !== false) |
|
| 95 | + if (($ret = @parse_url($uri)) !== false) |
|
| 96 | 96 | { |
| 97 | 97 | // decoding??? |
| 98 | - $this->_scheme = isset($ret['scheme'])?$ret['scheme']:''; |
|
| 99 | - $this->_host = isset($ret['host'])?$ret['host']:''; |
|
| 100 | - $this->_port = isset($ret['port'])?$ret['port']:''; |
|
| 101 | - $this->_user = isset($ret['user'])?$ret['user']:''; |
|
| 102 | - $this->_pass = isset($ret['pass'])?$ret['pass']:''; |
|
| 103 | - $this->_path = isset($ret['path'])?$ret['path']:''; |
|
| 104 | - $this->_query = isset($ret['query'])?$ret['query']:''; |
|
| 105 | - $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
|
| 98 | + $this->_scheme = isset($ret['scheme']) ? $ret['scheme'] : ''; |
|
| 99 | + $this->_host = isset($ret['host']) ? $ret['host'] : ''; |
|
| 100 | + $this->_port = isset($ret['port']) ? $ret['port'] : ''; |
|
| 101 | + $this->_user = isset($ret['user']) ? $ret['user'] : ''; |
|
| 102 | + $this->_pass = isset($ret['pass']) ? $ret['pass'] : ''; |
|
| 103 | + $this->_path = isset($ret['path']) ? $ret['path'] : ''; |
|
| 104 | + $this->_query = isset($ret['query']) ? $ret['query'] : ''; |
|
| 105 | + $this->_fragment = isset($ret['fragment']) ? $ret['fragment'] : ''; |
|
| 106 | 106 | $this->_uri = $uri; |
| 107 | 107 | } |
| 108 | 108 | else |
@@ -135,28 +135,24 @@ |
||
| 135 | 135 | { |
| 136 | 136 | $param->setData($data); |
| 137 | 137 | $this->_nextPageList = null; |
| 138 | - } |
|
| 139 | - else |
|
| 138 | + } else |
|
| 140 | 139 | { |
| 141 | 140 | $param->setData(array_slice($data, 0, $pageSize)); |
| 142 | 141 | $this->_nextPageList = array_slice($data, $pageSize - 1, $total); |
| 143 | 142 | } |
| 144 | - } |
|
| 145 | - else |
|
| 143 | + } else |
|
| 146 | 144 | { |
| 147 | 145 | if($total <= $pageSize) |
| 148 | 146 | { |
| 149 | 147 | $this->_prevPageList = array_slice($data, 0, $total); |
| 150 | 148 | $param->setData([]); |
| 151 | 149 | $this->_nextPageList = null; |
| 152 | - } |
|
| 153 | - elseif($total <= $pageSize * 2) |
|
| 150 | + } elseif($total <= $pageSize * 2) |
|
| 154 | 151 | { |
| 155 | 152 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 156 | 153 | $param->setData(array_slice($data, $pageSize, $total)); |
| 157 | 154 | $this->_nextPageList = null; |
| 158 | - } |
|
| 159 | - else |
|
| 155 | + } else |
|
| 160 | 156 | { |
| 161 | 157 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 162 | 158 | $param->setData(array_slice($data, $pageSize, $pageSize)); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $total = $data instanceof TList ? $data->getCount() : count($data); |
| 122 | 122 | $pageSize = $this->getPageSize(); |
| 123 | - if($total < 1) |
|
| 123 | + if ($total < 1) |
|
| 124 | 124 | { |
| 125 | 125 | $param->setData($data); |
| 126 | 126 | $this->_prevPageList = null; |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | return; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if($param->getNewPageIndex() < 1) |
|
| 131 | + if ($param->getNewPageIndex() < 1) |
|
| 132 | 132 | { |
| 133 | 133 | $this->_prevPageList = null; |
| 134 | - if($total <= $pageSize) |
|
| 134 | + if ($total <= $pageSize) |
|
| 135 | 135 | { |
| 136 | 136 | $param->setData($data); |
| 137 | 137 | $this->_nextPageList = null; |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | else |
| 146 | 146 | { |
| 147 | - if($total <= $pageSize) |
|
| 147 | + if ($total <= $pageSize) |
|
| 148 | 148 | { |
| 149 | 149 | $this->_prevPageList = array_slice($data, 0, $total); |
| 150 | 150 | $param->setData([]); |
| 151 | 151 | $this->_nextPageList = null; |
| 152 | 152 | } |
| 153 | - elseif($total <= $pageSize * 2) |
|
| 153 | + elseif ($total <= $pageSize * 2) |
|
| 154 | 154 | { |
| 155 | 155 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 156 | 156 | $param->setData(array_slice($data, $pageSize, $total)); |
@@ -46,8 +46,9 @@ |
||
| 46 | 46 | array_shift($args); |
| 47 | 47 | $n = count($args); |
| 48 | 48 | $tokens = []; |
| 49 | - for($i = 0;$i < $n;++$i) |
|
| 50 | - $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
|
| 49 | + for($i = 0;$i < $n;++$i) { |
|
| 50 | + $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
|
| 51 | + } |
|
| 51 | 52 | parent::__construct(strtr($errorMessage, $tokens)); |
| 52 | 53 | } |
| 53 | 54 | |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | array_shift($args); |
| 47 | 47 | $n = count($args); |
| 48 | 48 | $tokens = []; |
| 49 | - for($i = 0;$i < $n;++$i) |
|
| 50 | - $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
|
| 49 | + for ($i = 0; $i < $n; ++$i) |
|
| 50 | + $tokens['{'.$i.'}'] = TPropertyValue::ensureString($args[$i]); |
|
| 51 | 51 | parent::__construct(strtr($errorMessage, $tokens)); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -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 | |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class THttpUtility |
| 22 | 22 | { |
| 23 | - private static $_encodeTable = ['<' => '<','>' => '>','"' => '"']; |
|
| 24 | - private static $_decodeTable = ['<' => '<','>' => '>','"' => '"']; |
|
| 25 | - private static $_stripTable = ['<' => '','>' => '','"' => '']; |
|
| 23 | + private static $_encodeTable = ['<' => '<', '>' => '>', '"' => '"']; |
|
| 24 | + private static $_decodeTable = ['<' => '<', '>' => '>', '"' => '"']; |
|
| 25 | + private static $_stripTable = ['<' => '', '>' => '', '"' => '']; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * HTML-encodes a string. |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | $code = strtoupper($this->getToggleKey()); |
| 87 | 87 | $info = '(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; |
| 88 | 88 | $link = '<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; |
| 89 | - $usage = 'Press ALT-' . $code . ' (Or CTRL-' . $code . ' on OS X) to'; |
|
| 89 | + $usage = 'Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; |
|
| 90 | 90 | $writer->write("{$usage} {$link} {$info}"); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function writeLine($str = '') |
| 55 | 55 | { |
| 56 | - $this->write($str . "\n"); |
|
| 56 | + $this->write($str."\n"); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | public function attach($owner) |
| 45 | 45 | { |
| 46 | 46 | $this->_owner = $owner; |
| 47 | - foreach($this->events() as $event => $handler) |
|
| 48 | - $owner->attachEventHandler($event, [$this,$handler]); |
|
| 47 | + foreach($this->events() as $event => $handler) { |
|
| 48 | + $owner->attachEventHandler($event, [$this,$handler]); |
|
| 49 | + } |
|
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | /** |
@@ -57,8 +58,9 @@ discard block |
||
| 57 | 58 | */ |
| 58 | 59 | public function detach($owner) |
| 59 | 60 | { |
| 60 | - foreach($this->events() as $event => $handler) |
|
| 61 | - $owner->detachEventHandler($event, [$this,$handler]); |
|
| 61 | + foreach($this->events() as $event => $handler) { |
|
| 62 | + $owner->detachEventHandler($event, [$this,$handler]); |
|
| 63 | + } |
|
| 62 | 64 | $this->_owner = null; |
| 63 | 65 | } |
| 64 | 66 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | public function attach($owner) |
| 45 | 45 | { |
| 46 | 46 | $this->_owner = $owner; |
| 47 | - foreach($this->events() as $event => $handler) |
|
| 48 | - $owner->attachEventHandler($event, [$this,$handler]); |
|
| 47 | + foreach ($this->events() as $event => $handler) |
|
| 48 | + $owner->attachEventHandler($event, [$this, $handler]); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function detach($owner) |
| 59 | 59 | { |
| 60 | - foreach($this->events() as $event => $handler) |
|
| 61 | - $owner->detachEventHandler($event, [$this,$handler]); |
|
| 60 | + foreach ($this->events() as $event => $handler) |
|
| 61 | + $owner->detachEventHandler($event, [$this, $handler]); |
|
| 62 | 62 | $this->_owner = null; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -111,8 +111,9 @@ |
||
| 111 | 111 | $fkeys = $this->findForeignKeys($fkObjects[0], $source); |
| 112 | 112 | for($i = 0;$i < $total;$i++) |
| 113 | 113 | { |
| 114 | - foreach($fkeys as $fKey => $srcKey) |
|
| 115 | - $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
|
| 114 | + foreach($fkeys as $fKey => $srcKey) { |
|
| 115 | + $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
|
| 116 | + } |
|
| 116 | 117 | $success = $fkObjects[$i]->save() && $success; |
| 117 | 118 | } |
| 118 | 119 | } |
@@ -105,13 +105,13 @@ |
||
| 105 | 105 | $obj = $this->getContext()->getSourceRecord(); |
| 106 | 106 | $fkObjects = &$obj->{$this->getContext()->getProperty()}; |
| 107 | 107 | $success = true; |
| 108 | - if(($total = count($fkObjects)) > 0) |
|
| 108 | + if (($total = count($fkObjects)) > 0) |
|
| 109 | 109 | { |
| 110 | 110 | $source = $this->getSourceRecord(); |
| 111 | 111 | $fkeys = $this->findForeignKeys($fkObjects[0], $source); |
| 112 | - for($i = 0;$i < $total;$i++) |
|
| 112 | + for ($i = 0; $i < $total; $i++) |
|
| 113 | 113 | { |
| 114 | - foreach($fkeys as $fKey => $srcKey) |
|
| 114 | + foreach ($fkeys as $fKey => $srcKey) |
|
| 115 | 115 | $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
| 116 | 116 | $success = $fkObjects[$i]->save() && $success; |
| 117 | 117 | } |