@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); |
111 | 111 | $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); |
112 | 112 | |
113 | - foreach($files as $file) { |
|
113 | + foreach ($files as $file) { |
|
114 | 114 | if ($file->isFile()) { |
115 | 115 | |
116 | 116 | $content = json_decode(file_get_contents($file->getPath() . '/' . $file->getFilename()), true); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); |
240 | 240 | $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); |
241 | 241 | |
242 | - foreach($files as $file) { |
|
242 | + foreach ($files as $file) { |
|
243 | 243 | if ($file->isDir()) { |
244 | 244 | // @codeCoverageIgnoreStart |
245 | 245 | rmdir($file->getRealPath()); |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | $path = []; |
357 | 357 | |
358 | 358 | $path['filter'] = $this->directory . '/' . $this->tableFilterLogs . '/' . $ip . '.' . $this->extension; |
359 | - $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension; |
|
360 | - $path['rule'] = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension; |
|
359 | + $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension; |
|
360 | + $path['rule'] = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension; |
|
361 | 361 | |
362 | 362 | return $path[$type] ?? ''; |
363 | 363 | } |
@@ -149,7 +149,7 @@ |
||
149 | 149 | return $results; |
150 | 150 | } |
151 | 151 | |
152 | - /** |
|
152 | + /** |
|
153 | 153 | * {@inheritDoc} |
154 | 154 | */ |
155 | 155 | protected function doFetchAll(string $type = 'filter'): array |
@@ -280,9 +280,9 @@ discard block |
||
280 | 280 | protected function doDelete(string $ip, string $type = 'filter'): bool |
281 | 281 | { |
282 | 282 | switch ($type) { |
283 | - case 'rule' : return $this->remove($this->tableRuleList, ['log_ip' => $ip]); |
|
283 | + case 'rule' : return $this->remove($this->tableRuleList, ['log_ip' => $ip]); |
|
284 | 284 | case 'filter': return $this->remove($this->tableFilterLogs, ['log_ip' => $ip]); |
285 | - case 'session' : return $this->remove($this->tableSessions, ['id' => $ip]); |
|
285 | + case 'session' : return $this->remove($this->tableSessions, ['id' => $ip]); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | return false; |
@@ -308,14 +308,14 @@ discard block |
||
308 | 308 | private function update(string $table, array $data, array $where) |
309 | 309 | { |
310 | 310 | $placeholder = []; |
311 | - foreach($data as $k => $v) { |
|
311 | + foreach ($data as $k => $v) { |
|
312 | 312 | $placeholder[] = "$k = :$k"; |
313 | 313 | } |
314 | 314 | |
315 | 315 | $dataPlaceholder = implode(', ', $placeholder); |
316 | 316 | |
317 | 317 | $placeholder = []; |
318 | - foreach($where as $k => $v) { |
|
318 | + foreach ($where as $k => $v) { |
|
319 | 319 | $placeholder[] = "$k = :$k"; |
320 | 320 | } |
321 | 321 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | $bind = array_merge($data, $where); |
329 | 329 | |
330 | - foreach($bind as $k => $v) { |
|
330 | + foreach ($bind as $k => $v) { |
|
331 | 331 | |
332 | 332 | // @codeCoverageIgnoreStart |
333 | 333 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | |
356 | 356 | // @codeCoverageIgnoreStart |
357 | 357 | |
358 | - } catch(Exception $e) { |
|
358 | + } catch (Exception $e) { |
|
359 | 359 | throw $e->getMessage(); |
360 | 360 | return false; |
361 | 361 | } |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | { |
376 | 376 | $placeholderField = []; |
377 | 377 | $placeholderValue = []; |
378 | - foreach($data as $k => $v) { |
|
378 | + foreach ($data as $k => $v) { |
|
379 | 379 | $placeholderField[] = "`$k`"; |
380 | 380 | $placeholderValue[] = ":$k"; |
381 | 381 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $sql = 'INSERT INTO ' . $table . ' (' . $dataPlaceholderField . ') VALUES (' . $dataPlaceholderValue . ')'; |
388 | 388 | $query = $this->db->prepare($sql); |
389 | 389 | |
390 | - foreach($data as $k => $v) { |
|
390 | + foreach ($data as $k => $v) { |
|
391 | 391 | |
392 | 392 | // @codeCoverageIgnoreStart |
393 | 393 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | // @codeCoverageIgnoreStart |
417 | 417 | |
418 | - } catch(Exception $e) { |
|
418 | + } catch (Exception $e) { |
|
419 | 419 | return false; |
420 | 420 | } |
421 | 421 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | { |
435 | 435 | |
436 | 436 | $placeholder = []; |
437 | - foreach($where as $k => $v) { |
|
437 | + foreach ($where as $k => $v) { |
|
438 | 438 | $placeholder[] = "`$k` = :$k"; |
439 | 439 | } |
440 | 440 | |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $sql = 'DELETE FROM ' . $table . ' WHERE ' . $dataPlaceholder; |
446 | 446 | $query = $this->db->prepare($sql); |
447 | 447 | |
448 | - foreach($where as $k => $v) { |
|
448 | + foreach ($where as $k => $v) { |
|
449 | 449 | |
450 | 450 | // @codeCoverageIgnoreStart |
451 | 451 | |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | |
469 | 469 | // @codeCoverageIgnoreStart |
470 | 470 | |
471 | - } catch(Exception $e) { |
|
471 | + } catch (Exception $e) { |
|
472 | 472 | return false; |
473 | 473 | } |
474 | 474 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | $messenger = new MailgunTest($apiKey, $domain); |
58 | 58 | |
59 | - foreach($recipients as $recipient) { |
|
59 | + foreach ($recipients as $recipient) { |
|
60 | 60 | if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) { |
61 | 61 | $messenger->addRecipient($recipient); |
62 | 62 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | $messenger = new MailTest(); |
56 | 56 | |
57 | - foreach($recipients as $recipient) { |
|
57 | + foreach ($recipients as $recipient) { |
|
58 | 58 | if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) { |
59 | 59 | $messenger->addRecipient($recipient); |
60 | 60 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | $messenger = new SendgridTest($apiKey); |
58 | 58 | |
59 | - foreach($recipients as $recipient) { |
|
59 | + foreach ($recipients as $recipient) { |
|
60 | 60 | if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) { |
61 | 61 | $messenger->addRecipient($recipient); |
62 | 62 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $messenger = new SmtpTest($user, $pass, $host, (int) $port); |
71 | 71 | |
72 | - foreach($recipients as $recipient) { |
|
72 | + foreach ($recipients as $recipient) { |
|
73 | 73 | if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) { |
74 | 74 | $messenger->addRecipient($recipient); |
75 | 75 | } |