Passed
Push — master ( 3d0d87...075b69 )
by Antonio Carlos
09:13
created
src/Firewall.php 1 patch
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     /**
131 131
      * Clear firewall table.
132 132
      *
133
-     * @return mixed
133
+     * @return integer
134 134
      */
135 135
     public function clear()
136 136
     {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     /**
239 239
      * Get the list of all IP addresses stored.
240 240
      *
241
-     * @return mixed
241
+     * @return \Illuminate\Support\Collection
242 242
      */
243 243
     public function report()
244 244
     {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
      *
275 275
      * @param $ip
276 276
      *
277
-     * @return bool|string
277
+     * @return null|string
278 278
      */
279 279
     public function whichList($ip)
280 280
     {
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
     /**
324 324
      * Get a response to the attack.
325 325
      *
326
-     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse|null
326
+     * @return null|\Illuminate\Http\Response
327 327
      */
328 328
     public function responseToAttack()
329 329
     {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      *
336 336
      * @param $ip
337 337
      *
338
-     * @return bool|string
338
+     * @return string|null
339 339
      */
340 340
     public function getCountryFromIp($ip)
341 341
     {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
     /**
358 358
      * Get the GeoIP instance.
359 359
      *
360
-     * @return object
360
+     * @return \PragmaRX\Support\GeoIp\GeoIp
361 361
      */
362 362
     public function getGeoIp()
363 363
     {
Please login to merge, or discard this patch.
src/Listeners/NotifyAdmins.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace PragmaRX\Firewall\Listeners;
4 4
 
5
-use ErrorException;
6 5
 use Exception;
7 6
 use Notification as IlluminateNotification;
8 7
 use PragmaRX\Firewall\Events\AttackDetected;
Please login to merge, or discard this patch.
src/Repositories/Cache/Cache.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     /**
48 48
      * Check if cache has key.
49 49
      *
50
-     * @param $key
50
+     * @param string $key
51 51
      *
52 52
      * @return bool
53 53
      */
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
     /**
64 64
      * Get a value from the cache.
65 65
      *
66
-     * @param $key
66
+     * @param string|null $key
67 67
      *
68
-     * @return mixed|null
68
+     * @return \Illuminate\Contracts\Cache\Repository|null
69 69
      */
70 70
     public function get($key)
71 71
     {
Please login to merge, or discard this patch.
src/Repositories/IpList.php 2 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     /**
65 65
      * Remove the ip address from an array list.
66 66
      *
67
-     * @param $type
67
+     * @param string $type
68 68
      * @param $ip
69 69
      *
70 70
      * @return bool
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      *
92 92
      * @param \Illuminate\Database\Eloquent\Model $ip
93 93
      *
94
-     * @return bool
94
+     * @return boolean|null
95 95
      */
96 96
     private function removeFromDatabaseList($ip)
97 97
     {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     /**
138 138
      * Read a file contents.
139 139
      *
140
-     * @param $file
140
+     * @param string $file
141 141
      *
142 142
      * @return array
143 143
      */
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
     /**
247 247
      * Merge IP lists.
248 248
      *
249
-     * @param $database_ips
250
-     * @param $config_ips
249
+     * @param \Illuminate\Support\Collection $database_ips
250
+     * @param \Illuminate\Support\Collection $config_ips
251 251
      *
252 252
      * @return \Illuminate\Support\Collection
253 253
      */
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      * Add ip or range to array list.
368 368
      *
369 369
      * @param $whitelist
370
-     * @param $ip
370
+     * @param string $ip
371 371
      *
372 372
      * @return array|mixed
373 373
      */
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
     /**
477 477
      * Find ip address in all lists.
478 478
      *
479
-     * @param $ip
479
+     * @param string $ip
480 480
      *
481 481
      * @return \Illuminate\Database\Eloquent\Model|null|static
482 482
      */
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
      *
497 497
      * @param $ip
498 498
      *
499
-     * @return \Illuminate\Database\Eloquent\Model
499
+     * @return FirewallModel|null
500 500
      */
501 501
     private function nonDatabaseFind($ip)
502 502
     {
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
      * Add ip or range to database.
512 512
      *
513 513
      * @param $whitelist
514
-     * @param $ip
514
+     * @param string $ip
515 515
      *
516 516
      * @return \Illuminate\Database\Eloquent\Model
517 517
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
     private function getNonDatabaseIps()
35 35
     {
36 36
         return array_merge_recursive(
37
-            array_map(function ($ip) {
37
+            array_map(function($ip) {
38 38
                 $ip['whitelisted'] = true;
39 39
 
40 40
                 return $ip;
41 41
             }, $this->formatIpArray($this->config()->get('whitelist'))),
42 42
 
43
-            array_map(function ($ip) {
43
+            array_map(function($ip) {
44 44
                 $ip['whitelisted'] = false;
45 45
 
46 46
                 return $ip;
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      */
162 162
     private function formatIpArray($list)
163 163
     {
164
-        return array_map(function ($ip) {
164
+        return array_map(function($ip) {
165 165
             return ['ip_address' => $ip];
166 166
         }, $this->makeArrayOfIps($list));
167 167
     }
@@ -426,8 +426,7 @@  discard block
 block discarded – undo
426 426
     public function addToProperList($whitelist, $ip)
427 427
     {
428 428
         $this->config()->get('use_database') ?
429
-            $this->addToDatabaseList($whitelist, $ip) :
430
-            $this->addToArrayList($whitelist, $ip);
429
+            $this->addToDatabaseList($whitelist, $ip) : $this->addToArrayList($whitelist, $ip);
431 430
     }
432 431
 
433 432
     /**
@@ -440,8 +439,7 @@  discard block
 block discarded – undo
440 439
     public function delete($ip)
441 440
     {
442 441
         $this->config()->get('use_database') ?
443
-            $this->removeFromDatabaseList($ip) :
444
-            $this->removeFromArrayList($ip);
442
+            $this->removeFromDatabaseList($ip) : $this->removeFromArrayList($ip);
445 443
     }
446 444
 
447 445
     /**
Please login to merge, or discard this patch.
src/Support/IpAddress.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     /**
61 61
      * Check if an ip v4 is valid.
62 62
      *
63
-     * @param $item
63
+     * @param string $item
64 64
      *
65 65
      * @return bool
66 66
      */
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace PragmaRX\Firewall\Support;
4 4
 
5
-use Exception;
6 5
 use PragmaRX\Support\IpAddress as SupportIpAddress;
7 6
 
8 7
 class IpAddress
Please login to merge, or discard this patch.