]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/security/BanManager.php
Apply PHP Code Beautifier on source code for linter automatic fixes
[github/shaarli/Shaarli.git] / application / security / BanManager.php
index 288cbde05fd2e77009b6622b8669729d02903ba6..7077af5b5f339576ffc5b2f54f220dc5e56665c3 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 
-
 namespace Shaarli\Security;
 
 use Psr\Log\LoggerInterface;
@@ -47,7 +46,8 @@ class BanManager
      * @param string          $banFile        Path to the file containing IP bans and failures
      * @param LoggerInterface $logger         PSR-3 logger to save login attempts in log directory
      */
-    public function __construct($trustedProxies, $nbAttempts, $banDuration, $banFile, LoggerInterface $logger) {
+    public function __construct($trustedProxies, $nbAttempts, $banDuration, $banFile, LoggerInterface $logger)
+    {
         $this->trustedProxies = $trustedProxies;
         $this->nbAttempts = $nbAttempts;
         $this->banDuration = $banDuration;
@@ -80,7 +80,7 @@ class BanManager
 
         if ($this->failures[$ip] >= $this->nbAttempts) {
             $this->bans[$ip] = time() + $this->banDuration;
-            $this->logger->info(format_log('IP address banned from login: '. $ip, $ip));
+            $this->logger->info(format_log('IP address banned from login: ' . $ip, $ip));
         }
         $this->writeBanFile();
     }
@@ -136,7 +136,7 @@ class BanManager
             unset($this->failures[$ip]);
         }
         unset($this->bans[$ip]);
-        $this->logger->info(format_log('Ban lifted for: '. $ip, $ip));
+        $this->logger->info(format_log('Ban lifted for: ' . $ip, $ip));
 
         $this->writeBanFile();
         return false;