Passed
Branch master (b3863d)
by Php Easy Api
05:23 queued 02:44
created
src/resta/Support/BootStaticManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
      *
15 15
      * @param null|string $path
16 16
      */
17
-    public static function setPath($path=null)
17
+    public static function setPath($path = null)
18 18
     {
19
-        if(!is_null($path)){
19
+        if (!is_null($path)) {
20 20
             self::$requestPath = $path;
21 21
         }
22 22
     }
Please login to merge, or discard this patch.
src/resta/Support/Macro.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param bool $static
34 34
      * @return bool
35 35
      */
36
-    protected function checkMacroConditions($static=false)
36
+    protected function checkMacroConditions($static = false)
37 37
     {
38 38
         return is_string($this->macro) &&
39 39
             Utils::isNamespaceExists($this->macro) &&
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
      * @param bool $static
47 47
      * @return bool
48 48
      */
49
-    protected function checkMacroInstanceOf($static=false)
49
+    protected function checkMacroInstanceOf($static = false)
50 50
     {
51
-        if($static){
51
+        if ($static) {
52 52
             return true;
53 53
         }
54 54
         return $this->app->resolve($this->macro) instanceof MacroAbleContracts;
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      * @param callable $callback
62 62
      * @return mixed
63 63
      */
64
-    public function get($method,callable $callback)
64
+    public function get($method, callable $callback)
65 65
     {
66
-        if($this->isMacro){
66
+        if ($this->isMacro) {
67 67
 
68
-            if(method_exists($resolve = $this->app->resolve($this->macro),$method)){
68
+            if (method_exists($resolve = $this->app->resolve($this->macro), $method)) {
69 69
                 return $resolve->macro($this->class);
70 70
             }
71 71
         }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
      * @param $class
90 90
      * @return $this
91 91
      */
92
-    public function isMacro($class,$static=false)
92
+    public function isMacro($class, $static = false)
93 93
     {
94 94
         // if the macro class is a valid object,
95 95
         // then this macro will return a boolean value if it has the specified methode.
96
-        if($this->checkMacroConditions($static)){
96
+        if ($this->checkMacroConditions($static)) {
97 97
 
98 98
             $this->isMacro  = true;
99 99
             $this->class    = $class;
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
      * @param $method
122 122
      * @return mixed
123 123
      */
124
-    public function with($macro,$concrete,$method=null)
124
+    public function with($macro, $concrete, $method = null)
125 125
     {
126
-        if($this->macro === null){
127
-            return $this($macro)->isMacro($concrete)->get($method,function() use($concrete){
126
+        if ($this->macro===null) {
127
+            return $this($macro)->isMacro($concrete)->get($method, function() use($concrete){
128 128
                 return $concrete;
129 129
             });
130 130
         }
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
      * @param $method
139 139
      * @return mixed
140 140
      */
141
-    public function withStatic($macro,$concrete)
141
+    public function withStatic($macro, $concrete)
142 142
     {
143
-        return $this($macro)->isMacro($concrete,true)->get(null,is_callable($concrete) ?
143
+        return $this($macro)->isMacro($concrete, true)->get(null, is_callable($concrete) ?
144 144
             $concrete : function() use($concrete){
145 145
                 return $concrete;
146 146
             });
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
      * @param null|string $macro
153 153
      * @return $this
154 154
      */
155
-    public function __invoke($macro=null)
155
+    public function __invoke($macro = null)
156 156
     {
157
-        if($macro!==null){
157
+        if ($macro!==null) {
158 158
             $this->macro = $macro;
159 159
         }
160 160
         return $this;
Please login to merge, or discard this patch.
src/resta/Exception/ExceptionManager.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @param null|string $msg
30 30
      */
31
-    public function invalidArgument($msg=null)
31
+    public function invalidArgument($msg = null)
32 32
     {
33 33
         throw new InvalidArgumentException($msg);
34 34
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @param null|string $msg
40 40
      */
41
-    public function badFunctionCall($msg=null)
41
+    public function badFunctionCall($msg = null)
42 42
     {
43 43
         throw new BadFunctionCallException($msg);
44 44
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @param null|string $msg
50 50
      */
51
-    public function badMethodCall($msg=null)
51
+    public function badMethodCall($msg = null)
52 52
     {
53 53
         throw new BadMethodCallException($msg);
54 54
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @param null|string $msg
60 60
      */
61
-    public function domain($msg=null)
61
+    public function domain($msg = null)
62 62
     {
63 63
         throw new DomainException($msg);
64 64
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      *
69 69
      * @param null|string $msg
70 70
      */
71
-    public function length($msg=null)
71
+    public function length($msg = null)
72 72
     {
73 73
         throw new LengthException($msg);
74 74
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      *
79 79
      * @param null|string $msg
80 80
      */
81
-    public function logic($msg=null)
81
+    public function logic($msg = null)
82 82
     {
83 83
         throw new LogicException($msg);
84 84
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      *
89 89
      * @param null|string $msg
90 90
      */
91
-    public function outOfRange($msg=null)
91
+    public function outOfRange($msg = null)
92 92
     {
93 93
         throw new OutOfRangeException($msg);
94 94
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      *
99 99
      * @param null|string $msg
100 100
      */
101
-    public function overflow($msg=null)
101
+    public function overflow($msg = null)
102 102
     {
103 103
         throw new OverflowException($msg);
104 104
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @param null|string $msg
110 110
      */
111
-    public function range($msg=null)
111
+    public function range($msg = null)
112 112
     {
113 113
         throw new RangeException($msg);
114 114
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      *
119 119
      * @param null|string $msg
120 120
      */
121
-    public function runtime($msg=null)
121
+    public function runtime($msg = null)
122 122
     {
123 123
         throw new RuntimeException($msg);
124 124
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      *
129 129
      * @param null|string $msg
130 130
      */
131
-    public function underflow($msg=null)
131
+    public function underflow($msg = null)
132 132
     {
133 133
         throw new UnderflowException($msg);
134 134
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      *
139 139
      * @param null|string $msg
140 140
      */
141
-    public function unexpectedValue($msg=null)
141
+    public function unexpectedValue($msg = null)
142 142
     {
143 143
         throw new UnexpectedValueException($msg);
144 144
     }
Please login to merge, or discard this patch.
src/resta/Contracts/ExceptionContracts.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@  discard block
 block discarded – undo
8 8
      * @param null|string $msg
9 9
      * @return mixed
10 10
      */
11
-    public function invalidArgument($msg=null);
11
+    public function invalidArgument($msg = null);
12 12
 
13 13
     /**
14 14
      * @param null|string $msg
15 15
      * @return mixed
16 16
      */
17
-    public function badFunctionCall($msg=null);
17
+    public function badFunctionCall($msg = null);
18 18
 
19 19
     /**
20 20
      * @param null|string $msg
21 21
      * @return mixed
22 22
      */
23
-    public function badMethodCall($msg=null);
23
+    public function badMethodCall($msg = null);
24 24
 
25 25
     /**
26 26
      * @param null|string $msg
27 27
      * @return mixed
28 28
      */
29
-    public function domain($msg=null);
29
+    public function domain($msg = null);
30 30
 
31 31
     /**
32 32
      * @param null|string $msg
33 33
      * @return mixed
34 34
      */
35
-    public function length($msg=null);
35
+    public function length($msg = null);
36 36
 
37 37
     /**
38 38
      * @param null|string $msg
39 39
      * @return mixed
40 40
      */
41
-    public function logic($msg=null);
41
+    public function logic($msg = null);
42 42
 
43 43
     /**
44 44
      * @return mixed
@@ -49,35 +49,35 @@  discard block
 block discarded – undo
49 49
      * @param null|string $msg
50 50
      * @return mixed
51 51
      */
52
-    public function outOfRange($msg=null);
52
+    public function outOfRange($msg = null);
53 53
 
54 54
     /**
55 55
      * @param null|string $msg
56 56
      * @return mixed
57 57
      */
58
-    public function overflow($msg=null);
58
+    public function overflow($msg = null);
59 59
 
60 60
     /**
61 61
      * @param null|string $msg
62 62
      * @return mixed
63 63
      */
64
-    public function range($msg=null);
64
+    public function range($msg = null);
65 65
 
66 66
     /**
67 67
      * @param null|string $msg
68 68
      * @return mixed
69 69
      */
70
-    public function runtime($msg=null);
70
+    public function runtime($msg = null);
71 71
 
72 72
     /**
73 73
      * @param null|string $msg
74 74
      * @return mixed
75 75
      */
76
-    public function underflow($msg=null);
76
+    public function underflow($msg = null);
77 77
 
78 78
     /**
79 79
      * @param null|string $msg
80 80
      * @return mixed
81 81
      */
82
-    public function unexpectedValue($msg=null);
82
+    public function unexpectedValue($msg = null);
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Exception/ExceptionTrace.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
      * @param null $name
15 15
      * @param array $params
16 16
      */
17
-    public function __construct($app,$name=null,$params=array())
17
+    public function __construct($app, $name = null, $params = array())
18 18
     {
19 19
         parent::__construct($app);
20 20
 
21 21
         // we help the user to pull a special message from
22 22
         // the translate section to be specified by the user for the exception.
23
-        $this->exceptionTranslate($name,$params);
23
+        $this->exceptionTranslate($name, $params);
24 24
 
25 25
         // for real file path with
26 26
         // debug backtrace method are doing follow.
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
      * @param $name
34 34
      * @param array $params
35 35
      */
36
-    private function exceptionTranslate($name,$params=array())
36
+    private function exceptionTranslate($name, $params = array())
37 37
     {
38
-        if($name!==null){
39
-            if(count($params)){
40
-                $this->app->register('exceptionTranslateParams',$name,$params);
38
+        if ($name!==null) {
39
+            if (count($params)) {
40
+                $this->app->register('exceptionTranslateParams', $name, $params);
41 41
             }
42
-            $this->app->register('exceptionTranslate',$name);
42
+            $this->app->register('exceptionTranslate', $name);
43 43
         }
44 44
     }
45 45
 
@@ -50,23 +50,23 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function debugBackTrace()
52 52
     {
53
-        foreach (debug_backtrace() as $key=>$value){
53
+        foreach (debug_backtrace() as $key=>$value) {
54 54
 
55
-            if(isset(debug_backtrace()[$key],debug_backtrace()[$key]['file']))
55
+            if (isset(debug_backtrace()[$key], debug_backtrace()[$key]['file']))
56 56
             {
57
-                $this->app->register('exceptionFile',debug_backtrace()[$key]['file']);
58
-                $this->app->register('exceptionLine',debug_backtrace()[$key]['line']);
57
+                $this->app->register('exceptionFile', debug_backtrace()[$key]['file']);
58
+                $this->app->register('exceptionLine', debug_backtrace()[$key]['line']);
59 59
             }
60 60
 
61 61
             Dependencies::loadBootstrapperNeedsForException();
62 62
 
63
-            if(isset($value['file']) && isset(core()->urlComponent)){
64
-                if(preg_match('@'.core()->urlComponent['project'].'|boot|providers@',$value['file'])){
63
+            if (isset($value['file']) && isset(core()->urlComponent)) {
64
+                if (preg_match('@'.core()->urlComponent['project'].'|boot|providers@', $value['file'])) {
65 65
 
66 66
                     $this->app->terminate('exceptionFile');
67 67
                     $this->app->terminate('exceptionLine');
68
-                    $this->app->register('exceptionFile',$value['file']);
69
-                    $this->app->register('exceptionLine',$value['line']);
68
+                    $this->app->register('exceptionFile', $value['file']);
69
+                    $this->app->register('exceptionLine', $value['line']);
70 70
 
71 71
                     break;
72 72
                 }
@@ -86,20 +86,20 @@  discard block
 block discarded – undo
86 86
 
87 87
         // first, you are looking for an exception
88 88
         // in the application directory class.
89
-        if(Utils::isNamespaceExists($nameNamespace)){
89
+        if (Utils::isNamespaceExists($nameNamespace)) {
90 90
             $callNamespace = new $nameNamespace;
91 91
         }
92
-        else{
92
+        else {
93 93
 
94 94
             // if you do not have an exception in the application directory,
95 95
             // this time we are looking for an exception in the core directory.
96 96
             $nameNamespace = __NAMESPACE__.'\\'.$nameException;
97
-            if(Utils::isNamespaceExists($nameNamespace)){
97
+            if (Utils::isNamespaceExists($nameNamespace)) {
98 98
                 $callNamespace = new $nameNamespace;
99 99
             }
100 100
         }
101 101
 
102
-        if(isset($callNamespace)){
102
+        if (isset($callNamespace)) {
103 103
 
104 104
             // we will set the information about the exception trace,
105 105
             // and then bind it specifically to the event method.
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
 
112 112
 
113 113
             // we register the custom exception trace value with the global kernel object.
114
-            $this->app->register('exceptiontrace',$customExceptionTrace);
114
+            $this->app->register('exceptiontrace', $customExceptionTrace);
115 115
 
116 116
             //If the developer wants to execute an event when calling a special exception,
117 117
             //we process the event method.
118
-            if(method_exists($callNamespace,'event')){
118
+            if (method_exists($callNamespace, 'event')) {
119 119
                 $callNamespace->event($customExceptionTrace);
120 120
             }
121 121
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,8 +88,7 @@
 block discarded – undo
88 88
         // in the application directory class.
89 89
         if(Utils::isNamespaceExists($nameNamespace)){
90 90
             $callNamespace = new $nameNamespace;
91
-        }
92
-        else{
91
+        } else{
93 92
 
94 93
             // if you do not have an exception in the application directory,
95 94
             // this time we are looking for an exception in the core directory.
Please login to merge, or discard this patch.