@@ -33,7 +33,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * @param array $data |
12 | 12 | */ |
13 | - public function exception($data=array()) |
|
13 | + public function exception($data = array()) |
|
14 | 14 | { |
15 | - if(!isset($data['project']) and !isset($data['version'])){ |
|
15 | + if (!isset($data['project']) and !isset($data['version'])) { |
|
16 | 16 | exception()->notFoundException('No Project or Version'); |
17 | 17 | } |
18 | 18 | |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | |
22 | 22 | //If there is no project on the url |
23 | 23 | //we throw an exception |
24 | - if($data['project']===null OR !file_exists($appPath)){ |
|
24 | + if ($data['project']===null OR !file_exists($appPath)) { |
|
25 | 25 | exception()->notFoundException('No Project'); |
26 | 26 | } |
27 | 27 | |
28 | - if(!in_array($data['version'],UrlVersionIdentifier::supportedVersions())){ |
|
28 | + if (!in_array($data['version'], UrlVersionIdentifier::supportedVersions())) { |
|
29 | 29 | throw new DomainException('Version Number is not supported'); |
30 | 30 | } |
31 | 31 | |
32 | 32 | //If there is no endpoint on the url |
33 | 33 | //we throw an exception |
34 | - if($data['endpoint']===null){ |
|
34 | + if ($data['endpoint']===null) { |
|
35 | 35 | exception()->notFoundException('No Endpoint'); |
36 | 36 | } |
37 | 37 | } |
@@ -14,13 +14,13 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @param $name |
131 | 131 | * @param null|string $msg |
132 | 132 | */ |
133 | - public function customException($name,$msg=null) |
|
133 | + public function customException($name, $msg = null) |
|
134 | 134 | { |
135 | 135 | //We use the magic method for the exception and |
136 | 136 | //call the exception class in the application to get the instance. |
@@ -139,20 +139,20 @@ discard block |
||
139 | 139 | |
140 | 140 | // first, you are looking for an exception |
141 | 141 | // in the application directory class. |
142 | - if(Utils::isNamespaceExists($nameNamespace)){ |
|
142 | + if (Utils::isNamespaceExists($nameNamespace)) { |
|
143 | 143 | $callNamespace = new $nameNamespace($msg); |
144 | 144 | } |
145 | - else{ |
|
145 | + else { |
|
146 | 146 | |
147 | 147 | // if you do not have an exception in the application directory, |
148 | 148 | // this time we are looking for an exception in the core directory. |
149 | 149 | $nameNamespace = __NAMESPACE__.'\\'.$nameException; |
150 | - if(Utils::isNamespaceExists($nameNamespace)){ |
|
150 | + if (Utils::isNamespaceExists($nameNamespace)) { |
|
151 | 151 | $callNamespace = new $nameNamespace($msg); |
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if(isset($callNamespace)){ |
|
155 | + if (isset($callNamespace)) { |
|
156 | 156 | |
157 | 157 | // we will set the information about the exception trace, |
158 | 158 | // and then bind it specifically to the event method. |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | |
165 | 165 | |
166 | 166 | // we register the custom exception trace value with the global kernel object. |
167 | - $this->app->register('exceptiontrace',$customExceptionTrace); |
|
167 | + $this->app->register('exceptiontrace', $customExceptionTrace); |
|
168 | 168 | |
169 | 169 | //If the developer wants to execute an event when calling a special exception, |
170 | 170 | //we process the event method. |
171 | - if(method_exists($callNamespace,'event')){ |
|
171 | + if (method_exists($callNamespace, 'event')) { |
|
172 | 172 | $callNamespace->event($customExceptionTrace); |
173 | 173 | } |
174 | 174 | |
@@ -185,6 +185,6 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function __call($name, $arguments) |
187 | 187 | { |
188 | - $this->customException($name,current($arguments)); |
|
188 | + $this->customException($name, current($arguments)); |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | \ No newline at end of file |
@@ -88,8 +88,7 @@ discard block |
||
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. |
@@ -141,8 +140,7 @@ discard block |
||
141 | 140 | // in the application directory class. |
142 | 141 | if(Utils::isNamespaceExists($nameNamespace)){ |
143 | 142 | $callNamespace = new $nameNamespace($msg); |
144 | - } |
|
145 | - else{ |
|
143 | + } else{ |
|
146 | 144 | |
147 | 145 | // if you do not have an exception in the application directory, |
148 | 146 | // this time we are looking for an exception in the core directory. |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @param null|string $msg |
28 | 28 | */ |
29 | - public function invalidArgument($msg=null) |
|
29 | + public function invalidArgument($msg = null) |
|
30 | 30 | { |
31 | 31 | throw new InvalidArgumentException($msg); |
32 | 32 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @param null|string $msg |
38 | 38 | */ |
39 | - public function badFunctionCall($msg=null) |
|
39 | + public function badFunctionCall($msg = null) |
|
40 | 40 | { |
41 | 41 | throw new BadFunctionCallException($msg); |
42 | 42 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @param null|string $msg |
48 | 48 | */ |
49 | - public function badMethodCall($msg=null) |
|
49 | + public function badMethodCall($msg = null) |
|
50 | 50 | { |
51 | 51 | throw new BadMethodCallException($msg); |
52 | 52 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @param null|string $msg |
58 | 58 | */ |
59 | - public function domain($msg=null) |
|
59 | + public function domain($msg = null) |
|
60 | 60 | { |
61 | 61 | throw new DomainException($msg); |
62 | 62 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param null|string $msg |
68 | 68 | */ |
69 | - public function length($msg=null) |
|
69 | + public function length($msg = null) |
|
70 | 70 | { |
71 | 71 | throw new LengthException($msg); |
72 | 72 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @param null|string $msg |
78 | 78 | */ |
79 | - public function logic($msg=null) |
|
79 | + public function logic($msg = null) |
|
80 | 80 | { |
81 | 81 | throw new LogicException($msg); |
82 | 82 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return mixed|void |
89 | 89 | * |
90 | 90 | */ |
91 | - public function notFoundException($msg=null) |
|
91 | + public function notFoundException($msg = null) |
|
92 | 92 | { |
93 | 93 | return $this->notFound($msg); |
94 | 94 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @param null|string $msg |
100 | 100 | */ |
101 | - public function outOfRange($msg=null) |
|
101 | + public function outOfRange($msg = null) |
|
102 | 102 | { |
103 | 103 | throw new OutOfRangeException($msg); |
104 | 104 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @param null|string $msg |
110 | 110 | */ |
111 | - public function overflow($msg=null) |
|
111 | + public function overflow($msg = null) |
|
112 | 112 | { |
113 | 113 | throw new OverflowException($msg); |
114 | 114 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @param null|string $msg |
120 | 120 | */ |
121 | - public function range($msg=null) |
|
121 | + public function range($msg = null) |
|
122 | 122 | { |
123 | 123 | throw new RangeException($msg); |
124 | 124 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @param null|string $msg |
130 | 130 | */ |
131 | - public function runtime($msg=null) |
|
131 | + public function runtime($msg = null) |
|
132 | 132 | { |
133 | 133 | throw new RuntimeException($msg); |
134 | 134 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @param null|string $msg |
140 | 140 | */ |
141 | - public function underflow($msg=null) |
|
141 | + public function underflow($msg = null) |
|
142 | 142 | { |
143 | 143 | throw new UnderflowException($msg); |
144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @param null|string $msg |
150 | 150 | */ |
151 | - public function unexpectedValue($msg=null) |
|
151 | + public function unexpectedValue($msg = null) |
|
152 | 152 | { |
153 | 153 | throw new UnexpectedValueException($msg); |
154 | 154 | } |
@@ -8,77 +8,77 @@ |
||
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 | * @param null|string $msg |
45 | 45 | * @return mixed |
46 | 46 | */ |
47 | - public function notFoundException($msg=null); |
|
47 | + public function notFoundException($msg = null); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @param null|string $msg |
51 | 51 | * @return mixed |
52 | 52 | */ |
53 | - public function outOfRange($msg=null); |
|
53 | + public function outOfRange($msg = null); |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param null|string $msg |
57 | 57 | * @return mixed |
58 | 58 | */ |
59 | - public function overflow($msg=null); |
|
59 | + public function overflow($msg = null); |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * @param null|string $msg |
63 | 63 | * @return mixed |
64 | 64 | */ |
65 | - public function range($msg=null); |
|
65 | + public function range($msg = null); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @param null|string $msg |
69 | 69 | * @return mixed |
70 | 70 | */ |
71 | - public function runtime($msg=null); |
|
71 | + public function runtime($msg = null); |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * @param null|string $msg |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function underflow($msg=null); |
|
77 | + public function underflow($msg = null); |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @param null|string $msg |
81 | 81 | * @return mixed |
82 | 82 | */ |
83 | - public function unexpectedValue($msg=null); |
|
83 | + public function unexpectedValue($msg = null); |
|
84 | 84 | } |
85 | 85 | \ No newline at end of file |