Completed
Push — master ( 242e65...f5b54f )
by
unknown
04:49 queued 02:03
created
Zewa/Router.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@
 block discarded – undo
195 195
      * Set optional status header, and redirect to provided URL
196 196
      *
197 197
      * @access public
198
-     * @return bool
198
+     * @return false|null
199 199
      */
200 200
     public function redirect($url = '/', $status = null)
201 201
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@
 block discarded – undo
168 168
         if (is_null($this->baseURL)) {
169 169
             $self = $_SERVER['PHP_SELF'];
170 170
             $server = $_SERVER['HTTP_HOST']
171
-                      . rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');
171
+                        . rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');
172 172
 
173 173
             if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
174 174
                 || !empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa;
4 4
 
5 5
 use Zewa\Exception\RouteException;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function currentURL($params = false)
156 156
     {
157
-        return $this->currentURL . (empty($_SERVER['QUERY_STRING'])?:'?' . $_SERVER['QUERY_STRING']);
157
+        return $this->currentURL . (empty($_SERVER['QUERY_STRING']) ?: '?' . $_SERVER['QUERY_STRING']);
158 158
     }
159 159
 
160 160
     /**
Please login to merge, or discard this patch.
Zewa/Dependency.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $dependencies = $this->dependencies->get('__dependencies');
27 27
 
28
-        if(isset($dependencies[$class]) === false) {
28
+        if (isset($dependencies[$class]) === false) {
29 29
             return false;
30 30
         }
31 31
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $reflectionClass = new \ReflectionClass($class);
60 60
         $constructor = $reflectionClass->getConstructor();
61 61
 
62
-        if (! $constructor || $constructor->getParameters() === 0) {
62
+        if (!$constructor || $constructor->getParameters() === 0) {
63 63
             $dependency = new $class;
64 64
             return $this->load($class, $dependency, $persist);
65 65
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     private function injectAppInstance($dependency)
99 99
     {
100
-        if($dependency instanceof Controller) {
100
+        if ($dependency instanceof Controller) {
101 101
             $dependency->setEvent($this->resolve('\Sabre\Event\Emitter'));
102 102
             $dependency->setRequest($this->resolve('\Zewa\HTTP\Request'));
103 103
             $dependency->setRouter($this->resolve('\Zewa\Router'));
Please login to merge, or discard this patch.
Zewa/App.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa;
4 4
 
5 5
 use Sabre\Event\Emitter;
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $params = $this->router->getParameters();
92 92
 
93
-        if($request !== null) {
94
-            if(is_array($request)) {
93
+        if ($request !== null) {
94
+            if (is_array($request)) {
95 95
                 $callback = false;
96 96
                 $this->request->setRequest($this->dependency->resolve($request[0]));
97 97
                 $this->request->setMethod(($request[1]??[]));
98
-            }  else {
98
+            } else {
99 99
                 $callback = true;
100 100
                 $this->request->setRequest($request);
101 101
                 array_unshift($params, $this->dependency);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $method = $this->request->getMethod();
117 117
         $params = $this->request->getParams();
118 118
 
119
-        if($isRouteCallback === false) { // Routed Callback
119
+        if ($isRouteCallback === false) { // Routed Callback
120 120
             $this->output = call_user_func_array(
121 121
                 [&$request, $method],
122 122
                 $params
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
                 $callback = false;
96 96
                 $this->request->setRequest($this->dependency->resolve($request[0]));
97 97
                 $this->request->setMethod(($request[1]??[]));
98
-            }  else {
98
+            } else {
99 99
                 $callback = true;
100 100
                 $this->request->setRequest($request);
101 101
                 array_unshift($params, $this->dependency);
Please login to merge, or discard this patch.
Zewa/Security.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
     public function normalize($data)
16 16
     {
17
-        if(!isset($data)) {
17
+        if (!isset($data)) {
18 18
             return null;
19 19
         }
20 20
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 //@TODO this will not accept all float values, this validates /against/ syntax
49 49
 
50 50
                 if (($int === (int)trim($data, '-')) && strlen((string)(int)$data) === strlen($data)) {
51
-                    $data = (int) $data;
51
+                    $data = (int)$data;
52 52
                 } elseif ($int !== $float && preg_match($re, $data) === 1 && strlen($data) === strlen($float)) {
53 53
                     $data = $float;
54 54
                 }
Please login to merge, or discard this patch.
Zewa/HTTP/Put.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa\HTTP;
4 4
 
5 5
 use Zewa\Container;
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         parent::__construct($container, $security);
13 13
 
14
-        if($_SERVER['REQUEST_METHOD'] === "PUT") {
14
+        if ($_SERVER['REQUEST_METHOD'] === "PUT") {
15 15
             parse_str(file_get_contents('php://input', "r"), $put);
16 16
             $_POST = [];
17 17
         }
Please login to merge, or discard this patch.
Zewa/HTTP/SuperGlobal.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa\HTTP;
4 4
 
5 5
 use Zewa\Interfaces\HTTP\GlobalInterface;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function fetch(string $key = null, $default = null)
36 36
     {
37 37
         $global = $this->getGlobalName();
38
-        if($key === null) {
38
+        if ($key === null) {
39 39
             return $this->container->get($global);
40 40
         }
41 41
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function remove(string $key)
46 46
     {
47 47
         $global = $this->getGlobalName();
48
-        if($this->container->has($global)) {
48
+        if ($this->container->has($global)) {
49 49
             $this->processRemoval($key);
50 50
         }
51 51
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $global = $this->getGlobalName();
61 61
         $container = $this->container->get($global);
62
-        if(isset($container[$key])) {
62
+        if (isset($container[$key])) {
63 63
             unset($container[$key]);
64 64
             $this->container->set($global, $container);
65 65
         }
Please login to merge, or discard this patch.
Zewa/HTTP/Session.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa\HTTP;
4 4
 
5 5
 use Zewa\Container;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     private function incrementFlashStorage(array $storage)
51 51
     {
52 52
         foreach ($storage as $variable => $data) {
53
-            $storage[$variable]['increment'] ++;
53
+            $storage[$variable]['increment']++;
54 54
             if ($storage[$variable]['increment'] > 1) {
55 55
                 unset($_SESSION[$variable], $storage[$variable]);
56 56
             } else {
Please login to merge, or discard this patch.
Zewa/HTTP/Delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Zewa\HTTP;
4 4
 
5 5
 use Zewa\Container;
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         parent::__construct($container, $security);
13 13
 
14
-        if($_SERVER['REQUEST_METHOD'] === "DELETE") {
14
+        if ($_SERVER['REQUEST_METHOD'] === "DELETE") {
15 15
             parse_str(file_get_contents('php://input', "r"), $delete);
16 16
             $_POST = [];
17 17
         }
Please login to merge, or discard this patch.