@@ -461,8 +461,7 @@ |
||
461 | 461 | $statement = self::$_db->prepare($sql); |
462 | 462 | $statement->execute($params); |
463 | 463 | $result = $firstOnly ? |
464 | - $statement->fetch(PDO::FETCH_ASSOC) : |
|
465 | - $statement->fetchAll(PDO::FETCH_ASSOC); |
|
464 | + $statement->fetch(PDO::FETCH_ASSOC) : $statement->fetchAll(PDO::FETCH_ASSOC); |
|
466 | 465 | $statement->closeCursor(); |
467 | 466 | return $result; |
468 | 467 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | break; |
488 | 488 | case 'mssql': |
489 | 489 | $sql = 'SELECT name FROM sysobjects ' |
490 | - . "WHERE type = 'U' ORDER BY name"; |
|
490 | + . "WHERE type = 'U' ORDER BY name"; |
|
491 | 491 | break; |
492 | 492 | case 'mysql': |
493 | 493 | $sql = 'SHOW TABLES'; |
@@ -497,22 +497,22 @@ discard block |
||
497 | 497 | break; |
498 | 498 | case 'pgsql': |
499 | 499 | $sql = 'SELECT c.relname AS table_name ' |
500 | - . 'FROM pg_class c, pg_user u ' |
|
501 | - . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' " |
|
502 | - . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) ' |
|
503 | - . "AND c.relname !~ '^(pg_|sql_)' " |
|
504 | - . 'UNION ' |
|
505 | - . 'SELECT c.relname AS table_name ' |
|
506 | - . 'FROM pg_class c ' |
|
507 | - . "WHERE c.relkind = 'r' " |
|
508 | - . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) ' |
|
509 | - . 'AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) ' |
|
510 | - . "AND c.relname !~ '^pg_'"; |
|
500 | + . 'FROM pg_class c, pg_user u ' |
|
501 | + . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' " |
|
502 | + . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) ' |
|
503 | + . "AND c.relname !~ '^(pg_|sql_)' " |
|
504 | + . 'UNION ' |
|
505 | + . 'SELECT c.relname AS table_name ' |
|
506 | + . 'FROM pg_class c ' |
|
507 | + . "WHERE c.relkind = 'r' " |
|
508 | + . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) ' |
|
509 | + . 'AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) ' |
|
510 | + . "AND c.relname !~ '^pg_'"; |
|
511 | 511 | break; |
512 | 512 | case 'sqlite': |
513 | 513 | $sql = "SELECT name FROM sqlite_master WHERE type='table' " |
514 | - . 'UNION ALL SELECT name FROM sqlite_temp_master ' |
|
515 | - . "WHERE type='table' ORDER BY name"; |
|
514 | + . 'UNION ALL SELECT name FROM sqlite_temp_master ' |
|
515 | + . "WHERE type='table' ORDER BY name"; |
|
516 | 516 | break; |
517 | 517 | default: |
518 | 518 | throw new Exception( |
@@ -115,7 +115,7 @@ |
||
115 | 115 | if (is_array(self::$_translations[$messageId])) { |
116 | 116 | $number = (int) $args[1]; |
117 | 117 | $key = self::_getPluralForm($number); |
118 | - $max = count(self::$_translations[$messageId]) - 1; |
|
118 | + $max = count(self::$_translations[$messageId])-1; |
|
119 | 119 | if ($key > $max) { |
120 | 120 | $key = $max; |
121 | 121 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // We convert the hash into an array of integers. |
89 | 89 | $this->VALUES = array(); |
90 | - for ($i = 0; $i < $textlen; $i = $i + 2) { |
|
90 | + for ($i = 0; $i < $textlen; $i = $i+2) { |
|
91 | 91 | array_push($this->VALUES, hexdec(substr($text, $i, 2))); |
92 | 92 | } |
93 | 93 | $this->VALUES_INDEX = 0; // to walk the array. |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | for ($i = 0; $i < 7; ++$i) { |
110 | 110 | $action = $this->getInt(); |
111 | 111 | $color = imagecolorallocate($image, $r, $g, $b); |
112 | - $r = $r0 = ($r0 + $this->getInt() / 25) % 256; |
|
113 | - $g = $g0 = ($g0 + $this->getInt() / 25) % 256; |
|
114 | - $b = $b0 = ($b0 + $this->getInt() / 25) % 256; |
|
112 | + $r = $r0 = ($r0+$this->getInt() / 25) % 256; |
|
113 | + $g = $g0 = ($g0+$this->getInt() / 25) % 256; |
|
114 | + $b = $b0 = ($b0+$this->getInt() / 25) % 256; |
|
115 | 115 | $this->drawshape($image, $action, $color); |
116 | 116 | } |
117 | 117 | |
@@ -185,14 +185,14 @@ discard block |
||
185 | 185 | $sizeinv = imagesx($img); |
186 | 186 | } |
187 | 187 | $diffs = array( |
188 | - (($color2[0] - $color1[0]) / $size), |
|
189 | - (($color2[1] - $color1[1]) / $size), |
|
190 | - (($color2[2] - $color1[2]) / $size), |
|
188 | + (($color2[0]-$color1[0]) / $size), |
|
189 | + (($color2[1]-$color1[1]) / $size), |
|
190 | + (($color2[2]-$color1[2]) / $size), |
|
191 | 191 | ); |
192 | 192 | for ($i = 0; $i < $size; ++$i) { |
193 | - $r = $color1[0] + ($diffs[0] * $i); |
|
194 | - $g = $color1[1] + ($diffs[1] * $i); |
|
195 | - $b = $color1[2] + ($diffs[2] * $i); |
|
193 | + $r = $color1[0]+($diffs[0] * $i); |
|
194 | + $g = $color1[1]+($diffs[1] * $i); |
|
195 | + $b = $color1[2]+($diffs[2] * $i); |
|
196 | 196 | if ($direction == 'h') { |
197 | 197 | imageline($img, $i, 0, $i, $sizeinv, imagecolorallocate($img, $r, $g, $b)); |
198 | 198 | } else { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | break; |
228 | 228 | default: |
229 | 229 | $start = $this->getInt() * 360 / 256; |
230 | - $end = $start + $this->getInt() * 180 / 256; |
|
230 | + $end = $start+$this->getInt() * 180 / 256; |
|
231 | 231 | imagefilledarc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE); |
232 | 232 | } |
233 | 233 | } |
@@ -137,7 +137,7 @@ |
||
137 | 137 | // "*_options" sections don't require all defaults to be set |
138 | 138 | if ( |
139 | 139 | $section !== 'model_options' && |
140 | - ($from = strlen($section) - strlen($opts)) >= 0 && |
|
140 | + ($from = strlen($section)-strlen($opts)) >= 0 && |
|
141 | 141 | strpos($section, $opts, $from) !== false |
142 | 142 | ) { |
143 | 143 | if (is_int(current($values))) { |
@@ -270,10 +270,9 @@ |
||
270 | 270 | } |
271 | 271 | $thirdLevel = array_filter( |
272 | 272 | array_map( |
273 | - function ($filename) { |
|
273 | + function($filename) { |
|
274 | 274 | return strlen($filename) >= 20 ? |
275 | - substr($filename, 0, -4) : |
|
276 | - $filename; |
|
275 | + substr($filename, 0, -4) : $filename; |
|
277 | 276 | }, |
278 | 277 | scandir($path) |
279 | 278 | ), |
@@ -111,14 +111,14 @@ |
||
111 | 111 | // purge file of expired hashes to keep it small |
112 | 112 | $now = time(); |
113 | 113 | foreach ($tl as $key => $time) { |
114 | - if ($time + self::$_limit < $now) { |
|
114 | + if ($time+self::$_limit < $now) { |
|
115 | 115 | unset($tl[$key]); |
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | 119 | // this hash is used as an array key, hence a shorter algo is used |
120 | 120 | $hash = self::getHash('sha256'); |
121 | - if (array_key_exists($hash, $tl) && ($tl[$hash] + self::$_limit >= $now)) { |
|
121 | + if (array_key_exists($hash, $tl) && ($tl[$hash]+self::$_limit >= $now)) { |
|
122 | 122 | $result = false; |
123 | 123 | } else { |
124 | 124 | $tl[$hash] = time(); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | if (self::_exists($file)) { |
76 | 76 | require self::getPath($file); |
77 | 77 | $pl = $GLOBALS['purge_limiter']; |
78 | - if ($pl + self::$_limit >= $now) { |
|
78 | + if ($pl+self::$_limit >= $now) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | } |
@@ -105,10 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | // parse parameters, depending on request type |
107 | 107 | switch (array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'GET') { |
108 | - case 'DELETE': |
|
109 | - case 'PUT': |
|
110 | - case 'POST': |
|
111 | - $this->_params = Json::decode( |
|
108 | + case 'DELETE' : case 'PUT' : case 'POST' : $this->_params = Json::decode( |
|
112 | 109 | file_get_contents(self::$_inputStream) |
113 | 110 | ); |
114 | 111 | break; |
@@ -175,7 +172,7 @@ discard block |
||
175 | 172 | $data[$key] = $this->getParam($key); |
176 | 173 | } |
177 | 174 | // forcing a cast to int or float |
178 | - $data['v'] = $data['v'] + 0; |
|
175 | + $data['v'] = $data['v']+0; |
|
179 | 176 | return $data; |
180 | 177 | } |
181 | 178 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | throw new Exception(Controller::GENERIC_ERROR, 63); |
45 | 45 | } |
46 | 46 | // We kindly provide the remaining time before expiration (in seconds) |
47 | - $data['meta']['time_to_live'] = $data['meta']['expire_date'] - time(); |
|
47 | + $data['meta']['time_to_live'] = $data['meta']['expire_date']-time(); |
|
48 | 48 | unset($data['meta']['expire_date']); |
49 | 49 | } |
50 | 50 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $expire = $this->_conf->getKey($this->_conf->getKey('default', 'expire'), 'expire_options'); |
221 | 221 | } |
222 | 222 | if ($expire > 0) { |
223 | - $data['meta']['expire_date'] = time() + $expire; |
|
223 | + $data['meta']['expire_date'] = time()+$expire; |
|
224 | 224 | } |
225 | 225 | return $data; |
226 | 226 | } |