@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | session_set_cookie_params($this->config['cookieParams'] ?? []); |
55 | 55 | |
56 | 56 | // If the session failed to start |
57 | - if (! session_start()) { |
|
57 | + if (!session_start()) { |
|
58 | 58 | // Throw a new exception |
59 | 59 | throw new SessionStartFailure('The session failed to start!'); |
60 | 60 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setId(string $id): void |
86 | 86 | { |
87 | - if (! preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $id)) { |
|
87 | + if (!preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $id)) { |
|
88 | 88 | throw new InvalidSessionId( |
89 | 89 | "The session id, '{$id}', is invalid! " |
90 | 90 | . 'Session id can only contain alpha numeric characters, dashes, commas, ' |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function validateCsrf(string $id, string $token): bool |
139 | 139 | { |
140 | - if (! $this->has($id)) { |
|
140 | + if (!$this->has($id)) { |
|
141 | 141 | return false; |
142 | 142 | } |
143 | 143 | |
144 | 144 | $sessionToken = $this->get($id); |
145 | 145 | |
146 | - if (! is_string($sessionToken)) { |
|
146 | + if (!is_string($sessionToken)) { |
|
147 | 147 | return false; |
148 | 148 | } |
149 | 149 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | // If the session failed to start |
84 | - if (! session_start()) { |
|
84 | + if (!session_start()) { |
|
85 | 85 | // Throw a new exception |
86 | 86 | throw new SessionStartFailure('The session failed to start!'); |
87 | 87 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function remove(string $id): bool |
122 | 122 | { |
123 | - if (! $this->has($id)) { |
|
123 | + if (!$this->has($id)) { |
|
124 | 124 | return false; |
125 | 125 | } |
126 | 126 |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function setId(string $id): void |
124 | 124 | { |
125 | - if (! preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $id)) { |
|
125 | + if (!preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $id)) { |
|
126 | 126 | throw new InvalidSessionId( |
127 | 127 | "The session id, '{$id}', is invalid! " |
128 | 128 | . 'Session id can only contain alpha numeric characters, dashes, commas, ' |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function remove(string $id): bool |
214 | 214 | { |
215 | - if (! $this->has($id)) { |
|
215 | + if (!$this->has($id)) { |
|
216 | 216 | return false; |
217 | 217 | } |
218 | 218 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function validateCsrf(string $id, string $token): bool |
261 | 261 | { |
262 | - if (! $this->has($id)) { |
|
262 | + if (!$this->has($id)) { |
|
263 | 263 | return false; |
264 | 264 | } |
265 | 265 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | $container->setClosure( |
110 | 110 | Driver::class, |
111 | - static function (array $config, string $adapter) use ($container): Driver { |
|
111 | + static function(array $config, string $adapter) use ($container): Driver { |
|
112 | 112 | return new Driver( |
113 | 113 | $container->get( |
114 | 114 | $adapter, |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | $container->setClosure( |
136 | 136 | CacheAdapter::class, |
137 | - static function (array $config) use ($cache): CacheAdapter { |
|
137 | + static function(array $config) use ($cache): CacheAdapter { |
|
138 | 138 | return new CacheAdapter( |
139 | 139 | $cache, |
140 | 140 | $config |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $container->setClosure( |
159 | 159 | CookieAdapter::class, |
160 | - static function (array $config) use ($crypt, $request): CookieAdapter { |
|
160 | + static function(array $config) use ($crypt, $request): CookieAdapter { |
|
161 | 161 | return new CookieAdapter( |
162 | 162 | $crypt, |
163 | 163 | $request, |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $container->setClosure( |
180 | 180 | NullAdapter::class, |
181 | - static function (array $config): NullAdapter { |
|
181 | + static function(array $config): NullAdapter { |
|
182 | 182 | return new NullAdapter( |
183 | 183 | $config |
184 | 184 | ); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | { |
198 | 198 | $container->setClosure( |
199 | 199 | PHPAdapter::class, |
200 | - static function (array $config): PHPAdapter { |
|
200 | + static function(array $config): PHPAdapter { |
|
201 | 201 | return new PHPAdapter( |
202 | 202 | $config |
203 | 203 | ); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function dispatchClassMethod(Dispatch $dispatch, array $arguments = null) |
93 | 93 | { |
94 | 94 | // Ensure a class and method exist before continuing |
95 | - if (! $this->hasValidClassMethod($dispatch)) { |
|
95 | + if (!$this->hasValidClassMethod($dispatch)) { |
|
96 | 96 | return null; |
97 | 97 | } |
98 | 98 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | public function dispatchClassProperty(Dispatch $dispatch) |
115 | 115 | { |
116 | 116 | // Ensure a class and property exist before continuing |
117 | - if (! $this->hasValidClassProperty($dispatch)) { |
|
117 | + if (!$this->hasValidClassProperty($dispatch)) { |
|
118 | 118 | return null; |
119 | 119 | } |
120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function dispatchClass(Dispatch $dispatch, array $arguments = null) |
137 | 137 | { |
138 | 138 | // Ensure a class exists before continuing |
139 | - if (! $this->hasValidClass($dispatch)) { |
|
139 | + if (!$this->hasValidClass($dispatch)) { |
|
140 | 140 | return null; |
141 | 141 | } |
142 | 142 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function isInvalidClassMethod(Dispatch $dispatch): bool |
166 | 166 | { |
167 | - return $this->hasValidClassMethod($dispatch) && ! method_exists($dispatch->getClass(), $dispatch->getMethod()); |
|
167 | + return $this->hasValidClassMethod($dispatch) && !method_exists($dispatch->getClass(), $dispatch->getMethod()); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | protected function isInvalidClassProperty(Dispatch $dispatch): bool |
202 | 202 | { |
203 | 203 | return $this->hasValidClassProperty($dispatch) |
204 | - && ! property_exists($dispatch->getClass(), $dispatch->getProperty()); |
|
204 | + && !property_exists($dispatch->getClass(), $dispatch->getProperty()); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | protected function getClassFromDispatch(Dispatch $dispatch) |
229 | 229 | { |
230 | - if (! $dispatch->getClass()) { |
|
230 | + if (!$dispatch->getClass()) { |
|
231 | 231 | throw new InvalidArgumentException('Invalid class defined in dispatch model.'); |
232 | 232 | } |
233 | 233 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function dispatchFunction(Dispatch $dispatch, array $arguments = null) |
60 | 60 | { |
61 | 61 | // Ensure a function exists before continuing |
62 | - if (! $this->hasValidFunction($dispatch)) { |
|
62 | + if (!$this->hasValidFunction($dispatch)) { |
|
63 | 63 | return null; |
64 | 64 | } |
65 | 65 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function dispatchClosure(Dispatch $dispatch, array $arguments = null) |
82 | 82 | { |
83 | 83 | // Ensure a closure exists before continuing |
84 | - if (! $this->hasValidClosure($dispatch)) { |
|
84 | + if (!$this->hasValidClosure($dispatch)) { |
|
85 | 85 | return null; |
86 | 86 | } |
87 | 87 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | protected function isInvalidFunction(Dispatch $dispatch): bool |
103 | 103 | { |
104 | - return $this->hasValidFunction($dispatch) && ! is_callable($dispatch->getFunction()); |
|
104 | + return $this->hasValidFunction($dispatch) && !is_callable($dispatch->getFunction()); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $container->setClosure( |
112 | 112 | Driver::class, |
113 | - static function (array $config, string $adapter) use ($container): Driver { |
|
113 | + static function(array $config, string $adapter) use ($container): Driver { |
|
114 | 114 | return new Driver( |
115 | 115 | $container->get( |
116 | 116 | $adapter, |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $container->setClosure( |
136 | 136 | PsrAdapter::class, |
137 | - static function (array $config) use ($container): PsrAdapter { |
|
137 | + static function(array $config) use ($container): PsrAdapter { |
|
138 | 138 | return new PsrAdapter( |
139 | 139 | $container->get( |
140 | 140 | LoggerInterface::class, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $container->setClosure( |
161 | 161 | NullAdapter::class, |
162 | - static function (array $config): NullAdapter { |
|
162 | + static function(array $config): NullAdapter { |
|
163 | 163 | return new NullAdapter( |
164 | 164 | $config |
165 | 165 | ); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | { |
181 | 181 | $container->setClosure( |
182 | 182 | LoggerInterface::class, |
183 | - static function (array $config): LoggerInterface { |
|
183 | + static function(array $config): LoggerInterface { |
|
184 | 184 | $filePath = $config['filePath']; |
185 | 185 | $name = $config['name'] . date('-Y-m-d'); |
186 | 186 |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $this->config = $config; |
118 | 118 | $this->debug = $debug; |
119 | 119 | |
120 | - if (! self::$facadeSetup && $config['setupFacade']) { |
|
120 | + if (!self::$facadeSetup && $config['setupFacade']) { |
|
121 | 121 | Facade::setContainer($this); |
122 | 122 | } |
123 | 123 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | { |
411 | 411 | $serviceId = $this->getContextServiceId($serviceId, $this->context, $this->contextMethod); |
412 | 412 | |
413 | - if (! isset(self::$services[$serviceId])) { |
|
413 | + if (!isset(self::$services[$serviceId])) { |
|
414 | 414 | $this->ensureProvidedServiceIsPublished($serviceId); |
415 | 415 | } |
416 | 416 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | protected function ensureProvidedServiceIsPublished(string $serviceId): void |
506 | 506 | { |
507 | 507 | // Check if the service id is provided by a service provider and isn't already published |
508 | - if ($this->isProvided($serviceId) && ! $this->isPublished($serviceId)) { |
|
508 | + if ($this->isProvided($serviceId) && !$this->isPublished($serviceId)) { |
|
509 | 509 | // Publish the service provider |
510 | 510 | $this->publishProvided($serviceId); |
511 | 511 | } |
@@ -164,7 +164,7 @@ |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | // If this is not a dev environment |
167 | - if (! $this->debug) { |
|
167 | + if (!$this->debug) { |
|
168 | 168 | return; |
169 | 169 | } |
170 | 170 |