@@ -344,7 +344,7 @@ |
||
344 | 344 | |
345 | 345 | /** |
346 | 346 | * Returns the HTTP GET parameters. |
347 | - * @return array |
|
347 | + * @return string |
|
348 | 348 | */ |
349 | 349 | protected function getHttpGetParameters(): array |
350 | 350 | { |
@@ -115,7 +115,7 @@ |
||
115 | 115 | /** |
116 | 116 | * Constructor. |
117 | 117 | * |
118 | - * @param PMF_Configuration $config |
|
118 | + * @param Configuration $config |
|
119 | 119 | * @param string $user User |
120 | 120 | * |
121 | 121 | * @return LinkVerifier |
@@ -772,7 +772,7 @@ |
||
772 | 772 | $inforeasons[] = sprintf( |
773 | 773 | $PMF_LANG['ad_linkcheck_openurl_infoprefix'], |
774 | 774 | Strings::htmlspecialchars($value['absurl']) |
775 | - ).$value['reason']; |
|
775 | + ).$value['reason']; |
|
776 | 776 | } |
777 | 777 | } else { |
778 | 778 | $_classname = 'urlfail'; |
@@ -272,7 +272,7 @@ |
||
272 | 272 | foreach ($types as $type) { |
273 | 273 | preg_match_all("|[^?&]$type\=(\"?'?`?)([[:alnum:]\:\#%?=;&@/\ \.\_\-\{\}]+)\\1|i", $string, $matches); |
274 | 274 | $sz = sizeof($matches[2]); |
275 | - for ($i = 0;$i < $sz; ++$i) { |
|
275 | + for ($i = 0; $i < $sz; ++$i) { |
|
276 | 276 | $this->urlpool[$type][] = $matches[2][$i]; |
277 | 277 | ++$urlCount; |
278 | 278 | } |
@@ -20,7 +20,6 @@ |
||
20 | 20 | * @since 2009-09-11 |
21 | 21 | */ |
22 | 22 | |
23 | -use phpMyFAQ\Mail\Builtin; |
|
24 | 23 | use phpMyFAQ\Mail\SwiftSMTP; |
25 | 24 | |
26 | 25 | if (!defined('IS_VALID_PHPMYFAQ')) { |
@@ -490,8 +490,8 @@ |
||
490 | 490 | $this->headers['X-Mailer'] = $this->_mailer; |
491 | 491 | |
492 | 492 | // X-MSMail-Priority |
493 | - if (isset($this->priorities[(int) $this->priority])) { |
|
494 | - $this->headers['X-MSMail-Priority'] = $this->priorities[(int) $this->priority]; |
|
493 | + if (isset($this->priorities[(int)$this->priority])) { |
|
494 | + $this->headers['X-MSMail-Priority'] = $this->priorities[(int)$this->priority]; |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | // X-Originating-IP |
@@ -55,7 +55,7 @@ |
||
55 | 55 | /** |
56 | 56 | * Constructor. |
57 | 57 | * |
58 | - * @param PMF_Configuration $config |
|
58 | + * @param Configuration $config |
|
59 | 59 | * |
60 | 60 | * @return PMF_Network |
61 | 61 | */ |
@@ -153,8 +153,8 @@ |
||
153 | 153 | $bytes_addr = unpack('n*', inet_pton($addr)); |
154 | 154 | $bytes_test = unpack('n*', inet_pton($ip)); |
155 | 155 | |
156 | - for ($i = 1; $i <= ceil($preflen / 16); ++$i) { |
|
157 | - $left = $preflen - 16 * ($i - 1); |
|
156 | + for ($i = 1; $i <= ceil($preflen/16); ++$i) { |
|
157 | + $left = $preflen - 16*($i - 1); |
|
158 | 158 | if ($left > 16) { |
159 | 159 | $left = 16; |
160 | 160 | } |
@@ -171,7 +171,7 @@ |
||
171 | 171 | * We read in the current page from the baseUrl, so if it contains |
172 | 172 | * no pageParamName, first page is asumed |
173 | 173 | * |
174 | - * @param PMF_Configuration $config |
|
174 | + * @param Configuration $config |
|
175 | 175 | * @param array $options initialization options, |
176 | 176 | * possible options: |
177 | 177 | * - baseUrl (default "") |
@@ -277,8 +277,8 @@ |
||
277 | 277 | public function render() |
278 | 278 | { |
279 | 279 | $content = []; |
280 | - $pages = ceil($this->total / $this->perPage); |
|
281 | - $adjacents = floor($this->adjacents / 2) >= 1 ? floor($this->adjacents / 2) : 1; |
|
280 | + $pages = ceil($this->total/$this->perPage); |
|
281 | + $adjacents = floor($this->adjacents/2) >= 1 ? floor($this->adjacents/2) : 1; |
|
282 | 282 | |
283 | 283 | for ($page = 1; $page <= $pages; ++$page) { |
284 | 284 | if ($page > $this->adjacents && $page < $this->currentPage - $adjacents) { |
@@ -59,7 +59,7 @@ |
||
59 | 59 | /** |
60 | 60 | * Constructor. |
61 | 61 | * |
62 | - * @param PMF_Configuration $config |
|
62 | + * @param Configuration $config |
|
63 | 63 | * |
64 | 64 | * @return PMF_Stopwords |
65 | 65 | */ |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | /** |
281 | 281 | * Search and replace by a regexp using a callback. |
282 | 282 | * |
283 | - * @param string|array $pattern |
|
283 | + * @param string $pattern |
|
284 | 284 | * @param function $callback |
285 | 285 | * @param string|array $subject |
286 | 286 | * @param int $limit |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * |
315 | 315 | * @param string $str String |
316 | 316 | * |
317 | - * @return bool |
|
317 | + * @return string|boolean |
|
318 | 318 | */ |
319 | 319 | public static function isUTF8($str) |
320 | 320 | { |
@@ -182,9 +182,9 @@ |
||
182 | 182 | public static function isLangUTF8ToLatinConvertable($language) |
183 | 183 | { |
184 | 184 | $iso_languages = array('af', 'sq', 'br', 'ca', 'da', 'en', 'fo', 'gl', 'de', 'is', 'it', |
185 | - 'ku', 'la', 'lb', 'nb', 'oc', 'pt', 'es', 'sw', 'sv', 'wa', 'eu', |
|
186 | - // NOTE this languages are not fully supported by latin1 |
|
187 | - 'nl', 'fr', 'et', 'fi', 'cy', |
|
185 | + 'ku', 'la', 'lb', 'nb', 'oc', 'pt', 'es', 'sw', 'sv', 'wa', 'eu', |
|
186 | + // NOTE this languages are not fully supported by latin1 |
|
187 | + 'nl', 'fr', 'et', 'fi', 'cy', |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | return in_array($language, $iso_languages); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * Returns the current API version of phpMyFAQ for installation and |
165 | 165 | * version in the database. |
166 | 166 | * |
167 | - * @return int |
|
167 | + * @return string |
|
168 | 168 | */ |
169 | 169 | public static function getApiVersion() |
170 | 170 | { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @param Configuration $faqConfig |
211 | 211 | * |
212 | - * @return mixed |
|
212 | + * @return string |
|
213 | 213 | */ |
214 | 214 | public function getSystemUri(Configuration $faqConfig) |
215 | 215 | { |
@@ -88,10 +88,10 @@ |
||
88 | 88 | * @var array |
89 | 89 | */ |
90 | 90 | private $supportedDatabases = [ |
91 | - 'mysqli' => [ self::VERSION_MINIMUM_PHP, 'MySQL / Percona Server / MariaDB' ], |
|
92 | - 'pgsql' => [ self::VERSION_MINIMUM_PHP, 'PostgreSQL' ], |
|
93 | - 'sqlite3' => [ self::VERSION_MINIMUM_PHP, 'SQLite 3' ], |
|
94 | - 'sqlsrv' => [ self::VERSION_MINIMUM_PHP, 'MS SQL Server'] |
|
91 | + 'mysqli' => [self::VERSION_MINIMUM_PHP, 'MySQL / Percona Server / MariaDB'], |
|
92 | + 'pgsql' => [self::VERSION_MINIMUM_PHP, 'PostgreSQL'], |
|
93 | + 'sqlite3' => [self::VERSION_MINIMUM_PHP, 'SQLite 3'], |
|
94 | + 'sqlsrv' => [self::VERSION_MINIMUM_PHP, 'MS SQL Server'] |
|
95 | 95 | ]; |
96 | 96 | |
97 | 97 | /** |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * Returns the field $field of the user data. If $field is an |
72 | 72 | * array, an associative array will be returned. |
73 | 73 | * |
74 | - * @param mixed $field Field(s) |
|
74 | + * @param string $field Field(s) |
|
75 | 75 | * |
76 | 76 | * @return mixed |
77 | 77 | */ |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function load($userId) |
184 | 184 | { |
185 | - $userId = (int) $userId; |
|
185 | + $userId = (int)$userId; |
|
186 | 186 | if (($userId <= 0) && ($userId != -1)) { |
187 | 187 | return false; |
188 | 188 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function add($userId) |
252 | 252 | { |
253 | - $userId = (int) $userId; |
|
253 | + $userId = (int)$userId; |
|
254 | 254 | if (($userId <= 0) && ($userId != -1)) { |
255 | 255 | return false; |
256 | 256 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | */ |
286 | 286 | public function delete($userId) |
287 | 287 | { |
288 | - $userId = (int) $userId; |
|
288 | + $userId = (int)$userId; |
|
289 | 289 | if (($userId <= 0) && ($userId != -1)) { |
290 | 290 | return false; |
291 | 291 | } |