Completed
Push — master ( 1c40b3...c24efe )
by Tomas
15:53
created
src/Authorization/BearerTokenAuthorization.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,12 +68,12 @@
 block discarded – undo
68 68
             $range .= '/32';
69 69
         }
70 70
         // $range is in IP/CIDR format eg 127.0.0.1/24
71
-        list( $range, $netmask ) = explode('/', $range, 2);
71
+        list($range, $netmask) = explode('/', $range, 2);
72 72
         $range_decimal = ip2long($range);
73 73
         $ip_decimal = ip2long($ip);
74 74
         $wildcard_decimal = pow(2, (32 - $netmask)) - 1;
75 75
         $netmask_decimal = ~ $wildcard_decimal;
76
-        return ( ( $ip_decimal & $netmask_decimal ) == ( $range_decimal & $netmask_decimal ) );
76
+        return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal));
77 77
     }
78 78
 
79 79
     public function getErrorMessage()
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -68,6 +68,7 @@
 block discarded – undo
68 68
      *   '127.0.0.1,127.0.02' - accessible from multiple IP, separator could be new line or space
69 69
      *   '127.0.0.1/32'       - accessible from ip range
70 70
      *
71
+     * @param string|false $ipRestrictions
71 72
      * @return boolean
72 73
      */
73 74
     private function isValidIp($ipRestrictions)
Please login to merge, or discard this patch.
src/Presenters/ApiPresenter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
                 $_SERVER['REQUEST_URI'],
85 85
                 $this->ipDetector->getRequestIp(),
86 86
                 $_SERVER['HTTP_USER_AGENT'],
87
-                ($end-$start) * 1000
87
+                ($end - $start) * 1000
88 88
             );
89 89
         }
90 90
 
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Tomaj\NetteApi\Presenters;
4 4
 
5
+use Exception;
5 6
 use Nette\Application\Responses\JsonResponse;
6 7
 use Nette\Application\UI\Presenter;
7 8
 use Nette\Http\Response;
@@ -9,7 +10,6 @@  discard block
 block discarded – undo
9 10
 use Tomaj\NetteApi\ApiResponse;
10 11
 use Tomaj\NetteApi\Misc\IpDetectorInterface;
11 12
 use Tomaj\NetteApi\Params\ParamsProcessor;
12
-use Exception;
13 13
 
14 14
 class ApiPresenter extends Presenter
15 15
 {
Please login to merge, or discard this patch.
src/Params/ParamsProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     {
27 27
         $result = [];
28 28
         foreach ($this->params as $param) {
29
-            $result[ $param->getKey() ] = $param->getValue();
29
+            $result[$param->getKey()] = $param->getValue();
30 30
         }
31 31
 
32 32
         return $result;
Please login to merge, or discard this patch.
src/Component/ApiListingControl.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -46,6 +46,9 @@
 block discarded – undo
46 46
         $this->clickCallback->__invoke($method, $version, $package, $apiAction);
47 47
     }
48 48
 
49
+    /**
50
+     * @param \Tomaj\NetteApi\Handlers\ApiHandlerInterface[] $handlers
51
+     */
49 52
     private function sortHandlers($handlers)
50 53
     {
51 54
         $versionHandlers = [];
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 namespace Tomaj\NetteApi\Component;
4 4
 
5
+use Closure;
6
+use Exception;
5 7
 use Nette\Application\UI\Control;
6 8
 use Nette\ComponentModel\IContainer;
7 9
 use Tomaj\NetteApi\ApiDecider;
8
-use Closure;
9
-use Exception;
10 10
 
11 11
 class ApiListingControl extends Control
12 12
 {
Please login to merge, or discard this patch.