@@ -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; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public static function isValid($encoded) |
33 | 33 | { |
34 | - $accepted_keys = array('iv','v','iter','ks','ts','mode','adata','cipher','salt','ct'); |
|
34 | + $accepted_keys = array('iv', 'v', 'iter', 'ks', 'ts', 'mode', 'adata', 'cipher', 'salt', 'ct'); |
|
35 | 35 | |
36 | 36 | // Make sure content is valid json |
37 | 37 | $decoded = json_decode($encoded); |
@@ -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 | } |