@@ -61,7 +61,7 @@ |
||
61 | 61 | * @param string $query |
62 | 62 | * @param string $table |
63 | 63 | * |
64 | - * @return array |
|
64 | + * @return string[] |
|
65 | 65 | */ |
66 | 66 | public function buildInsertQueries($query, $table) |
67 | 67 | { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $password |
71 | 71 | * @param string $database |
72 | 72 | * |
73 | - * @return bool TRUE, if connected, otherwise FALSE |
|
73 | + * @return null|boolean TRUE, if connected, otherwise FALSE |
|
74 | 74 | */ |
75 | 75 | public function connect($host, $user, $password, $database = '') |
76 | 76 | { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * |
291 | 291 | * @param string $prefix Table prefix |
292 | 292 | * |
293 | - * @return array |
|
293 | + * @return string[] |
|
294 | 294 | */ |
295 | 295 | public function getTableNames($prefix = '') |
296 | 296 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param string $password Password |
67 | 67 | * @param string $database Database name |
68 | 68 | * |
69 | - * @return bool true, if connected, otherwise false |
|
69 | + * @return null|boolean true, if connected, otherwise false |
|
70 | 70 | */ |
71 | 71 | public function connect($host, $user, $password, $database = '') |
72 | 72 | { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | /** |
134 | 134 | * Fetch a result row as an object. |
135 | 135 | * |
136 | - * @param mixed $result |
|
136 | + * @param resource $result |
|
137 | 137 | * |
138 | 138 | * @return mixed |
139 | 139 | */ |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | /** |
193 | 193 | * Logs the queries. |
194 | 194 | * |
195 | - * @return int |
|
195 | + * @return string |
|
196 | 196 | */ |
197 | 197 | public function log() |
198 | 198 | { |
@@ -203,6 +203,7 @@ discard block |
||
203 | 203 | * Returns just one row. |
204 | 204 | * |
205 | 205 | * @param string |
206 | + * @param string $query |
|
206 | 207 | * |
207 | 208 | * @return string |
208 | 209 | */ |
@@ -294,7 +295,7 @@ discard block |
||
294 | 295 | * |
295 | 296 | * @param string $prefix Table prefix |
296 | 297 | * |
297 | - * @return array |
|
298 | + * @return string[] |
|
298 | 299 | */ |
299 | 300 | public function getTableNames($prefix = '') |
300 | 301 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param string |
69 | 69 | * @param string |
70 | 70 | * |
71 | - * @return bool |
|
71 | + * @return null|boolean |
|
72 | 72 | */ |
73 | 73 | public function connect($host, $user, $passwd, $db = '') |
74 | 74 | { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param int $offset |
89 | 89 | * @param int $rowcount |
90 | 90 | * |
91 | - * @return mixed $result |
|
91 | + * @return SQLite3Result $result |
|
92 | 92 | */ |
93 | 93 | public function query($query, $offset = 0, $rowcount = 0) |
94 | 94 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | /** |
125 | 125 | * Fetch a result row as an object. |
126 | 126 | * |
127 | - * @param mixed $result |
|
127 | + * @param SQLite3Result $result |
|
128 | 128 | * |
129 | 129 | * @return object or NULL if there are no more results |
130 | 130 | */ |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * |
158 | 158 | * @param SQLite3Result $result |
159 | 159 | * |
160 | - * @return array |
|
160 | + * @return SQLite3Result |
|
161 | 161 | */ |
162 | 162 | public function fetchAssoc($result) |
163 | 163 | { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | /** |
213 | 213 | * Logs the queries. |
214 | 214 | * |
215 | - * @return int |
|
215 | + * @return string |
|
216 | 216 | */ |
217 | 217 | public function log() |
218 | 218 | { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @param string $prefix Table prefix |
246 | 246 | * |
247 | - * @return array |
|
247 | + * @return string[] |
|
248 | 248 | */ |
249 | 249 | public function getTableNames($prefix = '') |
250 | 250 | { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $return = $result->fetchArray(SQLITE3_ASSOC); |
135 | 135 | |
136 | 136 | return $return |
137 | - ? (object) $return |
|
137 | + ? (object)$return |
|
138 | 138 | : null; |
139 | 139 | } |
140 | 140 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | $result->fetchedByPMF = true; |
186 | 186 | while ($row = $result->fetchArray(SQLITE3_ASSOC)) { |
187 | - $ret[] = (object) $row; |
|
187 | + $ret[] = (object)$row; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | return $ret; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function nextId($table, $id) |
299 | 299 | { |
300 | - $result = (int) $this->conn->querySingle( |
|
300 | + $result = (int)$this->conn->querySingle( |
|
301 | 301 | sprintf( |
302 | 302 | 'SELECT max(%s) AS current_id FROM %s', |
303 | 303 | $id, |
@@ -229,7 +229,7 @@ |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * @return string |
|
232 | + * @return integer |
|
233 | 233 | */ |
234 | 234 | public function getUserId() |
235 | 235 | { |
@@ -185,7 +185,7 @@ |
||
185 | 185 | * @param PMF_Faq $faq |
186 | 186 | * @param string $language |
187 | 187 | * |
188 | - * @return array |
|
188 | + * @return string |
|
189 | 189 | */ |
190 | 190 | public function createOverview(PMF_Category $category, PMF_Faq $faq, $language = '') |
191 | 191 | { |
@@ -262,7 +262,7 @@ |
||
262 | 262 | * Adds a configuration item for the database. |
263 | 263 | * |
264 | 264 | * @param string $name |
265 | - * @param mixed $value |
|
265 | + * @param string $value |
|
266 | 266 | * |
267 | 267 | * @return bool |
268 | 268 | */ |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function setId($id) |
107 | 107 | { |
108 | - $this->id = (int) $id; |
|
108 | + $this->id = (int)$id; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $select = sprintf( |
148 | 148 | 'SELECT * FROM %sfaqinstances WHERE id = %d', |
149 | 149 | PMF_Db::getTablePrefix(), |
150 | - (int) $id |
|
150 | + (int)$id |
|
151 | 151 | ); |
152 | 152 | |
153 | 153 | $result = $this->config->getDb()->query($select); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | PMF_Db::getTablePrefix(), |
221 | 221 | $data['instance'], |
222 | 222 | $data['comment'], |
223 | - (int) $id |
|
223 | + (int)$id |
|
224 | 224 | ); |
225 | 225 | |
226 | 226 | return $this->config->getDb()->query($update); |
@@ -239,12 +239,12 @@ discard block |
||
239 | 239 | sprintf( |
240 | 240 | 'DELETE FROM %sfaqinstances WHERE id = %d', |
241 | 241 | PMF_Db::getTablePrefix(), |
242 | - (int) $id |
|
242 | + (int)$id |
|
243 | 243 | ), |
244 | 244 | sprintf( |
245 | 245 | 'DELETE FROM %sfaqinstances_config WHERE instance_id = %d', |
246 | 246 | PMF_Db::getTablePrefix(), |
247 | - (int) $id |
|
247 | + (int)$id |
|
248 | 248 | ), |
249 | 249 | ); |
250 | 250 |
@@ -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); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * Returns the current API version of phpMyFAQ for installation and |
171 | 171 | * version in the database. |
172 | 172 | * |
173 | - * @return int |
|
173 | + * @return string |
|
174 | 174 | */ |
175 | 175 | public static function getApiVersion() |
176 | 176 | { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @param PMF_Configuration $faqConfig |
221 | 221 | * |
222 | - * @return mixed |
|
222 | + * @return string |
|
223 | 223 | */ |
224 | 224 | public function getSystemUri(PMF_Configuration $faqConfig) |
225 | 225 | { |
@@ -86,11 +86,11 @@ |
||
86 | 86 | * @var array |
87 | 87 | */ |
88 | 88 | private $supportedDatabases = [ |
89 | - 'mysqli' => [ self::VERSION_MINIMUM_PHP, 'MySQL 5.x / Percona Server 5.x / MariaDB 5.x and later' ], |
|
90 | - 'pgsql' => [ self::VERSION_MINIMUM_PHP, 'PostgreSQL 9.x' ], |
|
91 | - 'sqlite3' => [ self::VERSION_MINIMUM_PHP, 'SQLite 3' ], |
|
92 | - 'mssql' => [ self::VERSION_MINIMUM_PHP, 'MS SQL Server 2012 and later (deprecated)' ], |
|
93 | - 'sqlsrv' => [ self::VERSION_MINIMUM_PHP, 'MS SQL Server 2012 Driver for PHP'] |
|
89 | + 'mysqli' => [self::VERSION_MINIMUM_PHP, 'MySQL 5.x / Percona Server 5.x / MariaDB 5.x and later'], |
|
90 | + 'pgsql' => [self::VERSION_MINIMUM_PHP, 'PostgreSQL 9.x'], |
|
91 | + 'sqlite3' => [self::VERSION_MINIMUM_PHP, 'SQLite 3'], |
|
92 | + 'mssql' => [self::VERSION_MINIMUM_PHP, 'MS SQL Server 2012 and later (deprecated)'], |
|
93 | + 'sqlsrv' => [self::VERSION_MINIMUM_PHP, 'MS SQL Server 2012 Driver for PHP'] |
|
94 | 94 | ]; |
95 | 95 | |
96 | 96 | /** |