@@ -123,8 +123,7 @@ discard block |
||
123 | 123 | $user = Prado::createComponent($this->_userClass, $this); |
124 | 124 | $user->setIsGuest(true); |
125 | 125 | return $user; |
126 | - } |
|
127 | - else |
|
126 | + } else |
|
128 | 127 | return $this->_userFactory->createUser($username); |
129 | 128 | } |
130 | 129 | |
@@ -175,8 +174,7 @@ discard block |
||
175 | 174 | return $conn->getDbConnection(); |
176 | 175 | else |
177 | 176 | throw new TConfigurationException('dbusermanager_connectionid_invalid', $connectionID); |
178 | - } |
|
179 | - else |
|
177 | + } else |
|
180 | 178 | throw new TConfigurationException('dbusermanager_connectionid_required'); |
181 | 179 | } |
182 | 180 |
@@ -99,8 +99,7 @@ |
||
99 | 99 | { |
100 | 100 | $this->_everyone = true; |
101 | 101 | break; |
102 | - } |
|
103 | - elseif($user === '?') |
|
102 | + } elseif($user === '?') |
|
104 | 103 | $this->_guest = true; |
105 | 104 | elseif($user === '@') |
106 | 105 | $this->_authenticated = true; |
@@ -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 | } |
@@ -83,8 +83,7 @@ |
||
83 | 83 | $this->_d[] = $item; |
84 | 84 | ++$this->_c; |
85 | 85 | } |
86 | - } |
|
87 | - elseif($data !== null) |
|
86 | + } elseif($data !== null) |
|
88 | 87 | throw new TInvalidDataTypeException('stack_data_not_iterable'); |
89 | 88 | } |
90 | 89 |
@@ -84,8 +84,7 @@ |
||
84 | 84 | $this->_d[] = $item; |
85 | 85 | ++$this->_c; |
86 | 86 | } |
87 | - } |
|
88 | - elseif($data !== null) |
|
87 | + } elseif($data !== null) |
|
89 | 88 | throw new TInvalidDataTypeException('queue_data_not_iterable'); |
90 | 89 | } |
91 | 90 |
@@ -124,11 +124,9 @@ discard block |
||
124 | 124 | { |
125 | 125 | eval('$array=array' . $value . ';'); |
126 | 126 | return $array; |
127 | - } |
|
128 | - else |
|
127 | + } else |
|
129 | 128 | return $len > 0?[$value]:[]; |
130 | - } |
|
131 | - else |
|
129 | + } else |
|
132 | 130 | return (array)$value; |
133 | 131 | } |
134 | 132 | |
@@ -171,8 +169,7 @@ discard block |
||
171 | 169 | throw new TInvalidDataValueException( |
172 | 170 | 'propertyvalue_enumvalue_invalid', $value, |
173 | 171 | implode(' | ', $types[$enums]->getConstants())); |
174 | - } |
|
175 | - elseif(!is_array($enums)) |
|
172 | + } elseif(!is_array($enums)) |
|
176 | 173 | { |
177 | 174 | $enums = func_get_args(); |
178 | 175 | array_shift($enums); |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public static function ensureBoolean($value) |
64 | 64 | { |
65 | - if (is_string($value)) |
|
65 | + if(is_string($value)) |
|
66 | 66 | return strcasecmp($value, 'true') == 0 || $value != 0; |
67 | 67 | else |
68 | - return (boolean)$value; |
|
68 | + return (boolean) $value; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public static function ensureString($value) |
79 | 79 | { |
80 | - if (TJavaScript::isJsLiteral($value)) |
|
80 | + if(TJavaScript::isJsLiteral($value)) |
|
81 | 81 | return $value; |
82 | - if (is_bool($value)) |
|
83 | - return $value?'true':'false'; |
|
82 | + if(is_bool($value)) |
|
83 | + return $value ? 'true' : 'false'; |
|
84 | 84 | else |
85 | - return (string)$value; |
|
85 | + return (string) $value; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public static function ensureInteger($value) |
94 | 94 | { |
95 | - return (integer)$value; |
|
95 | + return (integer) $value; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function ensureFloat($value) |
104 | 104 | { |
105 | - return (float)$value; |
|
105 | + return (float) $value; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -120,16 +120,16 @@ discard block |
||
120 | 120 | { |
121 | 121 | $value = trim($value); |
122 | 122 | $len = strlen($value); |
123 | - if ($len >= 2 && $value[0] == '(' && $value[$len - 1] == ')') |
|
123 | + if($len >= 2 && $value[0] == '(' && $value[$len - 1] == ')') |
|
124 | 124 | { |
125 | 125 | eval('$array=array' . $value . ';'); |
126 | 126 | return $array; |
127 | 127 | } |
128 | 128 | else |
129 | - return $len > 0?[$value]:[]; |
|
129 | + return $len > 0 ? [$value] : []; |
|
130 | 130 | } |
131 | 131 | else |
132 | - return (array)$value; |
|
132 | + return (array) $value; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public static function ensureObject($value) |
141 | 141 | { |
142 | - return (object)$value; |
|
142 | + return (object) $value; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -190,6 +190,6 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public static function ensureNullIfEmpty($value) |
192 | 192 | { |
193 | - return empty($value)?null:$value; |
|
193 | + return empty($value) ?null:$value; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | \ No newline at end of file |
@@ -142,8 +142,7 @@ |
||
142 | 142 | { |
143 | 143 | $fcontent = include $fname; |
144 | 144 | $this->loadFromPhp($fcontent, dirname($fname), $configPagePath); |
145 | - } |
|
146 | - else |
|
145 | + } else |
|
147 | 146 | { |
148 | 147 | $dom = new TXmlDocument; |
149 | 148 | if($dom->loadFromFile($fname)) |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $rules = []; |
201 | 201 | foreach($config['authorization'] as $authorization) |
202 | 202 | { |
203 | - $patterns = isset($authorization['pages'])?$authorization['pages']:''; |
|
203 | + $patterns = isset($authorization['pages']) ? $authorization['pages'] : ''; |
|
204 | 204 | $ruleApplies = false; |
205 | 205 | if(empty($patterns) || trim($patterns) === '*') // null or empty string |
206 | 206 | $ruleApplies = true; |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | } |
232 | 232 | if($ruleApplies) |
233 | 233 | { |
234 | - $action = isset($authorization['action'])?$authorization['action']:''; |
|
235 | - $users = isset($authorization['users'])?$authorization['users']:''; |
|
236 | - $roles = isset($authorization['roles'])?$authorization['roles']:''; |
|
237 | - $verb = isset($authorization['verb'])?$authorization['verb']:''; |
|
238 | - $ips = isset($authorization['ips'])?$authorization['ips']:''; |
|
234 | + $action = isset($authorization['action']) ? $authorization['action'] : ''; |
|
235 | + $users = isset($authorization['users']) ? $authorization['users'] : ''; |
|
236 | + $roles = isset($authorization['roles']) ? $authorization['roles'] : ''; |
|
237 | + $verb = isset($authorization['verb']) ? $authorization['verb'] : ''; |
|
238 | + $ips = isset($authorization['ips']) ? $authorization['ips'] : ''; |
|
239 | 239 | $rules[] = new TAuthorizationRule($action, $users, $roles, $verb, $ips); |
240 | 240 | } |
241 | 241 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | unset($page['properties']); |
259 | 259 | } |
260 | 260 | $matching = false; |
261 | - $id = ($configPagePath === '')?$id:$configPagePath . '.' . $id; |
|
261 | + $id = ($configPagePath === '') ? $id : $configPagePath . '.' . $id; |
|
262 | 262 | if(strcasecmp($id, $this->_pagePath) === 0) |
263 | 263 | $matching = true; |
264 | 264 | elseif($id[strlen($id) - 1] === '*') // try wildcard matching |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | { |
274 | 274 | foreach($config['includes'] as $include) |
275 | 275 | { |
276 | - $when = isset($include['when'])?true:false; |
|
276 | + $when = isset($include['when']) ?true:false; |
|
277 | 277 | if(!isset($include['file'])) |
278 | 278 | throw new TConfigurationException('pageserviceconf_includefile_required'); |
279 | 279 | $filePath = $include['file']; |
280 | 280 | if(isset($this->_includes[$filePath])) |
281 | - $this->_includes[$filePath] = [$configPagePath,'(' . $this->_includes[$filePath][1] . ') || (' . $when . ')']; |
|
281 | + $this->_includes[$filePath] = [$configPagePath, '(' . $this->_includes[$filePath][1] . ') || (' . $when . ')']; |
|
282 | 282 | else |
283 | - $this->_includes[$filePath] = [$configPagePath,$when]; |
|
283 | + $this->_includes[$filePath] = [$configPagePath, $when]; |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | if(empty($id)) |
347 | 347 | throw new TConfigurationException('pageserviceconf_page_invalid', $configPath); |
348 | 348 | $matching = false; |
349 | - $id = ($configPagePath === '')?$id:$configPagePath . '.' . $id; |
|
349 | + $id = ($configPagePath === '') ? $id : $configPagePath . '.' . $id; |
|
350 | 350 | if(strcasecmp($id, $this->_pagePath) === 0) |
351 | 351 | $matching = true; |
352 | 352 | elseif($id[strlen($id) - 1] === '*') // try wildcard matching |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | if(($filePath = $node->getAttribute('file')) === null) |
365 | 365 | throw new TConfigurationException('pageserviceconf_includefile_required'); |
366 | 366 | if(isset($this->_includes[$filePath])) |
367 | - $this->_includes[$filePath] = [$configPagePath,'(' . $this->_includes[$filePath][1] . ') || (' . $when . ')']; |
|
367 | + $this->_includes[$filePath] = [$configPagePath, '(' . $this->_includes[$filePath][1] . ') || (' . $when . ')']; |
|
368 | 368 | else |
369 | - $this->_includes[$filePath] = [$configPagePath,$when]; |
|
369 | + $this->_includes[$filePath] = [$configPagePath, $when]; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
373 | 373 | \ No newline at end of file |
@@ -173,8 +173,7 @@ discard block |
||
173 | 173 | if(!is_file($dst . DIRECTORY_SEPARATOR . $fileName) || $checkTimestamp || $this->getApplication()->getMode() !== TApplicationMode::Performance) |
174 | 174 | $this->copyFile($fullpath, $dst); |
175 | 175 | return $this->_published[$path] = $this->_baseUrl . '/' . $dir . '/' . $fileName; |
176 | - } |
|
177 | - else |
|
176 | + } else |
|
178 | 177 | { |
179 | 178 | $dir = $this->hash($fullpath); |
180 | 179 | if(!is_dir($this->_basePath . DIRECTORY_SEPARATOR . $dir) || $checkTimestamp || $this->getApplication()->getMode() !== TApplicationMode::Performance) |
@@ -297,8 +296,7 @@ discard block |
||
297 | 296 | @copy($src . DIRECTORY_SEPARATOR . $file, $dst . DIRECTORY_SEPARATOR . $file); |
298 | 297 | @chmod($dst . DIRECTORY_SEPARATOR . $file, PRADO_CHMOD); |
299 | 298 | } |
300 | - } |
|
301 | - else |
|
299 | + } else |
|
302 | 300 | $this->copyDirectory($src . DIRECTORY_SEPARATOR . $file, $dst . DIRECTORY_SEPARATOR . $file); |
303 | 301 | } |
304 | 302 | closedir($folder); |
@@ -117,8 +117,7 @@ discard block |
||
117 | 117 | closedir($dir); |
118 | 118 | if($cacheValid) |
119 | 119 | $this->_skins = $skins; |
120 | - } |
|
121 | - else |
|
120 | + } else |
|
122 | 121 | { |
123 | 122 | $cacheValid = true; |
124 | 123 | $this->_cssFiles = $cssFiles; |
@@ -295,20 +294,16 @@ discard block |
||
295 | 294 | { |
296 | 295 | $setter = 'set' . $name; |
297 | 296 | $control->$setter($value); |
298 | - } |
|
299 | - else |
|
297 | + } else |
|
300 | 298 | throw new TConfigurationException('theme_property_readonly', $type, $name); |
301 | - } |
|
302 | - else |
|
299 | + } else |
|
303 | 300 | throw new TConfigurationException('theme_property_undefined', $type, $name); |
304 | - } |
|
305 | - else // complex property |
|
301 | + } else // complex property |
|
306 | 302 | $control->setSubProperty($name, $value); |
307 | 303 | } |
308 | 304 | } |
309 | 305 | return true; |
310 | - } |
|
311 | - else |
|
306 | + } else |
|
312 | 307 | return false; |
313 | 308 | } |
314 | 309 |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | elseif($skin[0] !== -1) |
153 | 153 | throw new TConfigurationException('theme_control_nested', $skin[1], dirname($themePath)); |
154 | 154 | $type = $skin[1]; |
155 | - $id = isset($skin[2]['skinid'])?$skin[2]['skinid']:0; |
|
155 | + $id = isset($skin[2]['skinid']) ? $skin[2]['skinid'] : 0; |
|
156 | 156 | unset($skin[2]['skinid']); |
157 | 157 | if(isset($this->_skins[$type][$id])) |
158 | 158 | throw new TConfigurationException('theme_skinid_duplicated', $type, $id, dirname($themePath)); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | sort($this->_cssFiles); |
172 | 172 | sort($this->_jsFiles); |
173 | 173 | if($cache !== null) |
174 | - $cache->set(self::THEME_CACHE_PREFIX . $themePath, [$this->_skins,$this->_cssFiles,$this->_jsFiles,time()]); |
|
174 | + $cache->set(self::THEME_CACHE_PREFIX . $themePath, [$this->_skins, $this->_cssFiles, $this->_jsFiles, time()]); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | $control->setData($text); |
52 | 52 | } |
53 | 53 | $cell->getControls()->add($control); |
54 | - } |
|
55 | - elseif($this->getAllowSorting()) |
|
54 | + } elseif($this->getAllowSorting()) |
|
56 | 55 | { |
57 | 56 | $sortExpression = $this->getSortExpression(); |
58 | 57 | if(($url = $this->getHeaderImageUrl()) !== '') |
@@ -65,8 +64,7 @@ discard block |
||
65 | 64 | $button->setAlternateText($text); |
66 | 65 | $button->setCausesValidation(false); |
67 | 66 | $cell->getControls()->add($button); |
68 | - } |
|
69 | - elseif($text !== '') |
|
67 | + } elseif($text !== '') |
|
70 | 68 | { |
71 | 69 | $button = new TActiveLinkButton; |
72 | 70 | $button->setText($text); |
@@ -74,11 +72,9 @@ discard block |
||
74 | 72 | $button->setCommandParameter($sortExpression); |
75 | 73 | $button->setCausesValidation(false); |
76 | 74 | $cell->getControls()->add($button); |
77 | - } |
|
78 | - else |
|
75 | + } else |
|
79 | 76 | $cell->setText(' '); |
80 | - } |
|
81 | - else |
|
77 | + } else |
|
82 | 78 | { |
83 | 79 | if(($url = $this->getHeaderImageUrl()) !== '') |
84 | 80 | { |
@@ -87,8 +83,7 @@ discard block |
||
87 | 83 | if($text !== '') |
88 | 84 | $image->setAlternateText($text); |
89 | 85 | $cell->getControls()->add($image); |
90 | - } |
|
91 | - elseif($text !== '') |
|
86 | + } elseif($text !== '') |
|
92 | 87 | $cell->setText($text); |
93 | 88 | else |
94 | 89 | $cell->setText(' '); |