@@ -77,7 +77,6 @@ discard block |
||
77 | 77 | * @access public |
78 | 78 | * @static |
79 | 79 | * @param string $messageId |
80 | - * @param mixed $args one or multiple parameters injected into placeholders |
|
81 | 80 | * @return string |
82 | 81 | */ |
83 | 82 | public static function _($messageId) |
@@ -91,7 +90,6 @@ discard block |
||
91 | 90 | * @access public |
92 | 91 | * @static |
93 | 92 | * @param string $messageId |
94 | - * @param mixed $args one or multiple parameters injected into placeholders |
|
95 | 93 | * @return string |
96 | 94 | */ |
97 | 95 | public static function translate($messageId) |
@@ -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 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | /** |
80 | 80 | * Gets, and creates if neccessary, a store object |
81 | 81 | * |
82 | - * @return AbstractData |
|
82 | + * @return Data\AbstractData |
|
83 | 83 | */ |
84 | 84 | private function _getStore() |
85 | 85 | { |
@@ -84,7 +84,7 @@ |
||
84 | 84 | require $path; |
85 | 85 | $pl = $GLOBALS['purge_limiter']; |
86 | 86 | |
87 | - if ($pl + self::$_limit >= $now) { |
|
87 | + if ($pl+self::$_limit >= $now) { |
|
88 | 88 | $result = false; |
89 | 89 | } else { |
90 | 90 | $result = true; |
@@ -92,9 +92,7 @@ |
||
92 | 92 | // parse parameters, depending on request type |
93 | 93 | switch (array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'GET') |
94 | 94 | { |
95 | - case 'DELETE': |
|
96 | - case 'PUT': |
|
97 | - parse_str(file_get_contents(self::$_inputStream), $this->_params); |
|
95 | + case 'DELETE' : case 'PUT' : parse_str(file_get_contents(self::$_inputStream), $this->_params); |
|
98 | 96 | break; |
99 | 97 | case 'POST': |
100 | 98 | $this->_params = $_POST; |
@@ -124,7 +124,7 @@ |
||
124 | 124 | // "*_options" sections don't require all defaults to be set |
125 | 125 | if ( |
126 | 126 | $section !== 'model_options' && |
127 | - ($from = strlen($section) - strlen($opts)) >= 0 && |
|
127 | + ($from = strlen($section)-strlen($opts)) >= 0 && |
|
128 | 128 | strpos($section, $opts, $from) !== false |
129 | 129 | ) |
130 | 130 | { |
@@ -33,8 +33,7 @@ |
||
33 | 33 | public static function stripslashesDeep($value) |
34 | 34 | { |
35 | 35 | return is_array($value) ? |
36 | - array_map('self::stripslashesDeep', $value) : |
|
37 | - stripslashes($value); |
|
36 | + array_map('self::stripslashesDeep', $value) : stripslashes($value); |
|
38 | 37 | } |
39 | 38 | |
40 | 39 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | throw new Exception(PrivateBin::GENERIC_ERROR, 63); |
46 | 46 | } |
47 | 47 | // We kindly provide the remaining time before expiration (in seconds) |
48 | - $data->meta->remaining_time = $data->meta->expire_date - time(); |
|
48 | + $data->meta->remaining_time = $data->meta->expire_date-time(); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // set formatter for for the view. |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $expire = $this->_conf->getKey($this->_conf->getKey('default', 'expire'), 'expire_options'); |
227 | 227 | } |
228 | 228 | if ($expire > 0) { |
229 | - $this->_data->meta->expire_date = time() + $expire; |
|
229 | + $this->_data->meta->expire_date = time()+$expire; |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 |
@@ -433,7 +433,7 @@ |
||
433 | 433 | * @access private |
434 | 434 | * @static |
435 | 435 | * @param string $sql |
436 | - * @param array $params |
|
436 | + * @param string[] $params |
|
437 | 437 | * @throws PDOException |
438 | 438 | * @return bool |
439 | 439 | */ |
@@ -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( |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | $opendiscussion = $burnafterreading = false; |
171 | - $attachment = $attachmentname = ''; |
|
171 | + $attachment = $attachmentname = ''; |
|
172 | 172 | $meta = $paste['meta']; |
173 | 173 | unset($meta['postdate']); |
174 | 174 | $expire_date = 0; |
@@ -461,8 +461,7 @@ discard block |
||
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 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * constructor |
63 | 63 | * |
64 | 64 | * @access public |
65 | - * @return void |
|
65 | + * @return string |
|
66 | 66 | */ |
67 | 67 | public function __construct() |
68 | 68 | { |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | * @access private |
174 | 174 | * @param resource $img |
175 | 175 | * @param string $direction |
176 | - * @param array $color1 |
|
177 | - * @param array $color2 |
|
176 | + * @param integer[] $color1 |
|
177 | + * @param integer[] $color2 |
|
178 | 178 | * @return resource |
179 | 179 | */ |
180 | 180 | private function degrade($img, $direction, $color1, $color2) |
@@ -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 | } |