Completed
Push — 4.0 ( 1533b9...4d1c3b )
by Marco
13:08
created
src/Service/Service.php 1 patch
Braces   +26 added lines, -10 removed lines patch added patch discarded remove patch
@@ -459,7 +459,9 @@  discard block
 block discarded – undo
459 459
      */
460 460
     final public function getHeader($header) {
461 461
 
462
-        if ( isset($this->headers[$header]) ) return $this->headers[$header];
462
+        if ( isset($this->headers[$header]) ) {
463
+            return $this->headers[$header];
464
+        }
463 465
 
464 466
         return null;
465 467
 
@@ -522,7 +524,9 @@  discard block
 block discarded – undo
522 524
      */
523 525
     final public function getImplementedMethods() {
524 526
 
525
-        if ( method_exists($this, 'any') ) return explode(",",$this->supported_http_methods);
527
+        if ( method_exists($this, 'any') ) {
528
+            return explode(",",$this->supported_http_methods);
529
+        }
526 530
 
527 531
         $supported_methods = explode(',',$this->supported_http_methods);
528 532
 
@@ -530,7 +534,9 @@  discard block
 block discarded – undo
530 534
 
531 535
         foreach ( $supported_methods as $method ) {
532 536
 
533
-            if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods,$method);
537
+            if ( method_exists($this, strtolower($method)) ) {
538
+                array_push($implemented_methods,$method);
539
+            }
534 540
 
535 541
         }
536 542
 
@@ -545,9 +551,11 @@  discard block
 block discarded – undo
545 551
      */
546 552
     final public function getCallableMethod($method) {
547 553
 
548
-        if ( method_exists($this, strtolower($method)) ) return strtolower($method);
549
-
550
-        else return "any";
554
+        if ( method_exists($this, strtolower($method)) ) {
555
+            return strtolower($method);
556
+        } else {
557
+            return "any";
558
+        }
551 559
 
552 560
     }
553 561
 
@@ -619,7 +627,9 @@  discard block
 block discarded – undo
619 627
      */
620 628
     final public function getAttribute($attribute) {
621 629
 
622
-        if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];
630
+        if ( isset($this->attributes[$attribute]) ) {
631
+            return $this->attributes[$attribute];
632
+        }
623 633
 
624 634
         return null;
625 635
 
@@ -665,7 +675,9 @@  discard block
 block discarded – undo
665 675
      */
666 676
     final public function getParameter($parameter) {
667 677
 
668
-        if ( isset($this->parameters[$parameter]) ) return $this->parameters[$parameter];
678
+        if ( isset($this->parameters[$parameter]) ) {
679
+            return $this->parameters[$parameter];
680
+        }
669 681
 
670 682
         return null;
671 683
 
@@ -690,7 +702,9 @@  discard block
 block discarded – undo
690 702
      */
691 703
     final public function getRequestHeader($header) {
692 704
 
693
-        if ( isset($this->request_headers[$header]) ) return $this->request_headers[$header];
705
+        if ( isset($this->request_headers[$header]) ) {
706
+            return $this->request_headers[$header];
707
+        }
694 708
 
695 709
         return null;
696 710
 
@@ -712,7 +726,9 @@  discard block
 block discarded – undo
712 726
 
713 727
         $methods_array = array();
714 728
 
715
-        foreach ($methods as $method) $methods_array[$method] = array();
729
+        foreach ($methods as $method) {
730
+            $methods_array[$method] = array();
731
+        }
716 732
 
717 733
         $methods_array['ANY'] = array();
718 734
 
Please login to merge, or discard this patch.
src/Components/Headers.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,11 +28,13 @@
 block discarded – undo
28 28
 
29 29
     final public function get($header = null) {
30 30
 
31
-        if ( is_null($header) ) return $this->headers;
32
-
33
-        else if ( array_key_exists($header, $this->headers) ) return $this->headers[$header];
34
-
35
-        else return null;
31
+        if ( is_null($header) ) {
32
+            return $this->headers;
33
+        } else if ( array_key_exists($header, $this->headers) ) {
34
+            return $this->headers[$header];
35
+        } else {
36
+            return null;
37
+        }
36 38
 
37 39
     }
38 40
 
Please login to merge, or discard this patch.
src/Components/Parameters.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 
29 29
     final public function get($parameter=null) {
30 30
 
31
-        if ( is_null($parameter) ) return $this->parameters;
32
-
33
-        else if ( array_key_exists($parameter, $this->parameters) ) {
31
+        if ( is_null($parameter) ) {
32
+            return $this->parameters;
33
+        } else if ( array_key_exists($parameter, $this->parameters) ) {
34 34
 
35 35
             return $this->parameters[$parameter];
36 36
 
37
+        } else {
38
+            return null;
37 39
         }
38 40
 
39
-        else return null;
40
-
41 41
     }
42 42
 
43 43
     final public function set($parameter, $value) {
Please login to merge, or discard this patch.
src/Request/Headers.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@
 block discarded – undo
41 41
      */
42 42
     private static function getHeaders() {
43 43
 
44
-        if ( function_exists('getallheaders') ) return getallheaders();
44
+        if ( function_exists('getallheaders') ) {
45
+            return getallheaders();
46
+        }
45 47
 
46 48
         $headers = array();
47 49
 
Please login to merge, or discard this patch.
src/Router/Collector.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,9 @@  discard block
 block discarded – undo
96 96
                 $this->response
97 97
             );
98 98
             
99
+        } else {
100
+            return null;
99 101
         }
100
-        else return null;
101 102
         
102 103
     }
103 104
 
@@ -183,7 +184,9 @@  discard block
 block discarded – undo
183 184
                 
184 185
                 if (preg_match('/' . $value['regex'] . '/', $bits[$key], $matches)) {
185 186
                     
186
-                    if (count($matches) == 1) $matches = $matches[0];
187
+                    if (count($matches) == 1) {
188
+                        $matches = $matches[0];
189
+                    }
187 190
                     
188 191
                     $this->request->query()->set($key, $matches);
189 192
                     
Please login to merge, or discard this patch.
src/Router/RoutingTable.php 1 patch
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,10 +68,11 @@  discard block
 block discarded – undo
68 68
         
69 69
         $regex = $this->readpath($folders);
70 70
         
71
-        if (isset($this->routes[$regex])) 
72
-            return $this->routes[$regex];
73
-        else 
74
-            return null;
71
+        if (isset($this->routes[$regex])) {
72
+                    return $this->routes[$regex];
73
+        } else {
74
+                    return null;
75
+        }
75 76
         
76 77
     }
77 78
     
@@ -81,7 +82,9 @@  discard block
 block discarded – undo
81 82
         
82 83
         $regex = $this->readpath($folders);
83 84
         
84
-        if (isset($this->routes[$regex])) unset($this->routes[$regex]);
85
+        if (isset($this->routes[$regex])) {
86
+            unset($this->routes[$regex]);
87
+        }
85 88
         
86 89
     }
87 90
     
@@ -99,7 +102,9 @@  discard block
 block discarded – undo
99 102
     
100 103
     private function readpath($folders = array(), &$value = null, $regex = '') {
101 104
         
102
-        if (!empty($folders) && empty($folders[0])) array_shift($folders);
105
+        if (!empty($folders) && empty($folders[0])) {
106
+            array_shift($folders);
107
+        }
103 108
         
104 109
         if (empty($folders)) {
105 110
             
Please login to merge, or discard this patch.