Completed
Push — master ( e819e3...e648d0 )
by Tomas
03:34
created
src/ApiDecider.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -79,6 +79,9 @@
 block discarded – undo
79 79
         return $list;
80 80
     }
81 81
     
82
+    /**
83
+     * @param ApiHandlerInterface $handler
84
+     */
82 85
     private function createParamsList($handler)
83 86
     {
84 87
         $paramsList = $handler['handler']->params();
Please login to merge, or discard this patch.
src/Authorization/ApiAuthorizationInterface.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -4,8 +4,14 @@
 block discarded – undo
4 4
 
5 5
 interface ApiAuthorizationInterface
6 6
 {
7
+    /**
8
+     * @return boolean
9
+     */
7 10
     public function authorized();
8 11
 
12
+    /**
13
+     * @return boolean
14
+     */
9 15
     public function getErrorMessage();
10 16
 
11 17
 //    public function getAuthorizedResource();
Please login to merge, or discard this patch.
src/Hanleds/ApiHandlerInterface.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,5 +10,8 @@
 block discarded – undo
10 10
 
11 11
     public function handle($params);
12 12
 
13
+    /**
14
+     * @return void
15
+     */
13 16
     public function setEndpointIdentifier(EndpointInterface $endpoint);
14 17
 }
Please login to merge, or discard this patch.
src/Params/ParamInterface.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -4,8 +4,14 @@
 block discarded – undo
4 4
 
5 5
 interface ParamInterface
6 6
 {
7
+    /**
8
+     * @return boolean
9
+     */
7 10
     public function isValid();
8 11
 
12
+    /**
13
+     * @return string
14
+     */
9 15
     public function getKey();
10 16
 
11 17
     public function getValue();
Please login to merge, or discard this patch.
src/authorization/BearerTokenAuthorization.php 1 patch
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.
src/presenters/ApiPresenter.php 1 patch
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.
src/Authorization/BearerTokenAuthorization.php 1 patch
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.
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/params/InputParam.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,9 +93,9 @@
 block discarded – undo
93 93
             return filter_input(INPUT_POST, $this->key);
94 94
         }
95 95
         if ($this->type == self::TYPE_FILE) {
96
-           if (isset($_FILES[$this->key])) {
97
-               return $_FILES[$this->key];
98
-           }
96
+            if (isset($_FILES[$this->key])) {
97
+                return $_FILES[$this->key];
98
+            }
99 99
         }
100 100
         
101 101
         throw new Exception("Invalid type");
Please login to merge, or discard this patch.