@@ -107,7 +107,7 @@ |
||
| 107 | 107 | { |
| 108 | 108 | $type = $packet[0] ?? null; |
| 109 | 109 | |
| 110 | - if (! array_key_exists($type, static::$socketTypes)) { |
|
| 110 | + if (!array_key_exists($type, static::$socketTypes)) { |
|
| 111 | 111 | return null; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $illuminateResponse = $this->getIlluminateResponse(); |
| 66 | 66 | |
| 67 | 67 | /* RFC2616 - 14.18 says all Responses need to have a Date */ |
| 68 | - if (! $illuminateResponse->headers->has('Date')) { |
|
| 68 | + if (!$illuminateResponse->headers->has('Date')) { |
|
| 69 | 69 | $illuminateResponse->setDate(\DateTime::createFromFormat('U', time())); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | protected function setIlluminateResponse($illuminateResponse) |
| 141 | 141 | { |
| 142 | - if (! $illuminateResponse instanceof SymfonyResponse) { |
|
| 142 | + if (!$illuminateResponse instanceof SymfonyResponse) { |
|
| 143 | 143 | $content = (string) $illuminateResponse; |
| 144 | 144 | $illuminateResponse = new IlluminateResponse($content); |
| 145 | 145 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | if ($sandbox->isLaravel()) { |
| 21 | 21 | $router = $app->make('router'); |
| 22 | 22 | $request = $sandbox->getRequest(); |
| 23 | - $closure = function () use ($app, $request) { |
|
| 23 | + $closure = function() use ($app, $request) { |
|
| 24 | 24 | $this->container = $app; |
| 25 | 25 | if (is_null($request)) { |
| 26 | 26 | return; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected function rebindProviderContainer($app, $provider) |
| 36 | 36 | { |
| 37 | - $closure = function () use ($app) { |
|
| 37 | + $closure = function() use ($app) { |
|
| 38 | 38 | $this->app = $app; |
| 39 | 39 | }; |
| 40 | 40 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | if ($sandbox->isLaravel()) { |
| 21 | 21 | $kernel = $app->make(Kernel::class); |
| 22 | 22 | |
| 23 | - $closure = function () use ($app) { |
|
| 23 | + $closure = function() use ($app) { |
|
| 24 | 24 | $this->app = $app; |
| 25 | 25 | }; |
| 26 | 26 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $view = $app->make('view'); |
| 20 | 20 | |
| 21 | - $closure = function () use ($app) { |
|
| 21 | + $closure = function() use ($app) { |
|
| 22 | 22 | $this->container = $app; |
| 23 | 23 | $this->shared['app'] = $app; |
| 24 | 24 | }; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct($app = null, $framework = null) |
| 36 | 36 | { |
| 37 | - if (! $app instanceof Container) { |
|
| 37 | + if (!$app instanceof Container) { |
|
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function initialize() |
| 104 | 104 | { |
| 105 | - if (! $this->app instanceof Container) { |
|
| 105 | + if (!$this->app instanceof Container) { |
|
| 106 | 106 | throw new SandboxException('A base app has not been set.'); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function run(Request $request) |
| 151 | 151 | { |
| 152 | - if (! $this->getSnapshot() instanceof Container) { |
|
| 152 | + if (!$this->getSnapshot() instanceof Container) { |
|
| 153 | 153 | throw new SandboxException('Sandbox is not enabled.'); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $response->sendContent(); |
| 200 | 200 | } elseif ($response instanceof SymfonyResponse) { |
| 201 | 201 | $content = $response->getContent(); |
| 202 | - } elseif (! $isFile = $response instanceof BinaryFileResponse) { |
|
| 202 | + } elseif (!$isFile = $response instanceof BinaryFileResponse) { |
|
| 203 | 203 | $content = (string) $response; |
| 204 | 204 | } |
| 205 | 205 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $this->terminate($request, $response); |
| 208 | 208 | |
| 209 | 209 | // append ob content to response |
| 210 | - if (! $isFile && ob_get_length() > 0) { |
|
| 210 | + if (!$isFile && ob_get_length() > 0) { |
|
| 211 | 211 | if ($isStream) { |
| 212 | 212 | $response->output = ob_get_contents(); |
| 213 | 213 | } else { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function enable() |
| 282 | 282 | { |
| 283 | - if (! $this->config instanceof ConfigContract) { |
|
| 283 | + if (!$this->config instanceof ConfigContract) { |
|
| 284 | 284 | throw new SandboxException('Please initialize after setting base app.'); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $providers = $this->config->get('swoole_http.providers', []); |
| 49 | 49 | |
| 50 | 50 | foreach ($providers as $provider) { |
| 51 | - if (class_exists($provider) && ! in_array($provider, $this->providers)) { |
|
| 51 | + if (class_exists($provider) && !in_array($provider, $this->providers)) { |
|
| 52 | 52 | $providerClass = new $provider($app); |
| 53 | 53 | $this->providers[$provider] = $providerClass; |
| 54 | 54 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | foreach ($resetters as $resetter) { |
| 75 | 75 | $resetterClass = $app->make($resetter); |
| 76 | - if (! $resetterClass instanceof ResetterContract) { |
|
| 76 | + if (!$resetterClass instanceof ResetterContract) { |
|
| 77 | 77 | throw new SandboxException("{$resetter} must implement " . ResetterContract::class); |
| 78 | 78 | } |
| 79 | 79 | $this->resetters[$resetter] = $resetterClass; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function startSession(Request $request) |
| 62 | 62 | { |
| 63 | - return tap($this->getSession($request), function (Session $session) use ($request) { |
|
| 63 | + return tap($this->getSession($request), function(Session $session) use ($request) { |
|
| 64 | 64 | $session->setRequestOnHandler($request); |
| 65 | 65 | |
| 66 | 66 | $session->start(); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function getSession(Request $request) |
| 78 | 78 | { |
| 79 | - return tap($this->manager->driver(), function (Session $session) use ($request) { |
|
| 79 | + return tap($this->manager->driver(), function(Session $session) use ($request) { |
|
| 80 | 80 | $session->setId($request->cookies->get($session->getName())); |
| 81 | 81 | }); |
| 82 | 82 | } |