@@ -20,10 +20,10 @@ |
||
20 | 20 | |
21 | 21 | public function __invoke(string $path) |
22 | 22 | { |
23 | - if ($this->isOptional && file_exists($path . '/.do_not_clear')) { |
|
23 | + if ($this->isOptional && file_exists($path.'/.do_not_clear')) { |
|
24 | 24 | return; |
25 | 25 | } |
26 | - foreach (\glob(\rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*') as $file) { |
|
26 | + foreach (\glob(\rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*') as $file) { |
|
27 | 27 | \is_dir($file) ? $this->__invoke($file) : \unlink($file); |
28 | 28 | @\rmdir($file); |
29 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function toString() |
23 | 23 | { |
24 | - $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL; |
|
24 | + $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL; |
|
25 | 25 | |
26 | 26 | return $this->view; |
27 | 27 | } |
@@ -30,10 +30,10 @@ |
||
30 | 30 | |
31 | 31 | public function newApp(AbstractAppMeta $appMeta, string $contexts, Cache $cache = null) : AbstractApp |
32 | 32 | { |
33 | - $cacheNs = (string) filemtime($appMeta->appDir . '/src'); |
|
33 | + $cacheNs = (string) filemtime($appMeta->appDir.'/src'); |
|
34 | 34 | $injector = new AppInjector($appMeta->name, $contexts, $appMeta, $cacheNs); |
35 | 35 | $cache = $cache instanceof Cache ? $cache : $injector->getCachedInstance(Cache::class); |
36 | - $appId = $appMeta->name . $contexts . $cacheNs; |
|
36 | + $appId = $appMeta->name.$contexts.$cacheNs; |
|
37 | 37 | $app = $cache->fetch($appId); |
38 | 38 | if ($app instanceof AbstractApp) { |
39 | 39 | return $app; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function toString() |
23 | 23 | { |
24 | - $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL; |
|
24 | + $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL; |
|
25 | 25 | |
26 | 26 | return $this->view; |
27 | 27 | } |
@@ -21,17 +21,17 @@ |
||
21 | 21 | $contextsArray = array_reverse(explode('-', $context)); |
22 | 22 | $module = new NullModule; |
23 | 23 | foreach ($contextsArray as $context) { |
24 | - $class = $appMeta->name . '\Module\\' . ucwords($context) . 'Module'; |
|
25 | - if (! class_exists($class)) { |
|
26 | - $class = 'BEAR\Package\Context\\' . ucwords($context) . 'Module'; |
|
24 | + $class = $appMeta->name.'\Module\\'.ucwords($context).'Module'; |
|
25 | + if (!class_exists($class)) { |
|
26 | + $class = 'BEAR\Package\Context\\'.ucwords($context).'Module'; |
|
27 | 27 | } |
28 | - if (! is_a($class, AbstractModule::class, true)) { |
|
28 | + if (!is_a($class, AbstractModule::class, true)) { |
|
29 | 29 | throw new InvalidContextException($context); |
30 | 30 | } |
31 | 31 | /* @var $module AbstractModule */ |
32 | 32 | $module = is_subclass_of($class, AbstractAppModule::class) ? new $class($appMeta, $module) : new $class($module); |
33 | 33 | } |
34 | - if (! $module instanceof AbstractModule) { |
|
34 | + if (!$module instanceof AbstractModule) { |
|
35 | 35 | throw new \LogicException; // @codeCoverageIgnore |
36 | 36 | } |
37 | 37 | $module->override(new AppMetaModule($appMeta)); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | foreach ($this->routers as $route) { |
35 | 35 | $match = $route->match($globals, $server); |
36 | - if ($match instanceof RouterMatch && ! ($match instanceof NullMatch)) { |
|
36 | + if ($match instanceof RouterMatch && !($match instanceof NullMatch)) { |
|
37 | 37 | return $match; |
38 | 38 | } |
39 | 39 | } |
@@ -18,15 +18,15 @@ |
||
18 | 18 | public function __invoke(ResourceObject $ro, array $server) |
19 | 19 | { |
20 | 20 | unset($server); |
21 | - if (! $ro->view) { |
|
21 | + if (!$ro->view) { |
|
22 | 22 | $ro->toString(); |
23 | 23 | } |
24 | 24 | // code |
25 | 25 | $statusText = (new Code)->statusText[$ro->code]; |
26 | - $ob = $ro->code . ' ' . $statusText . PHP_EOL; |
|
26 | + $ob = $ro->code.' '.$statusText.PHP_EOL; |
|
27 | 27 | // header |
28 | 28 | foreach ($ro->headers as $label => $value) { |
29 | - $ob .= "{$label}: {$value}" . PHP_EOL; |
|
29 | + $ob .= "{$label}: {$value}".PHP_EOL; |
|
30 | 30 | } |
31 | 31 | // empty line |
32 | 32 | $ob .= PHP_EOL; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->bind(RouterInterface::class)->to(CliRouter::class); |
27 | 27 | $this->bind(TransferInterface::class)->to(CliResponder::class); |
28 | 28 | $this->bind(HttpCacheInterface::class)->to(CliHttpCache::class); |
29 | - $stdIn = tempnam(sys_get_temp_dir(), 'stdin-' . crc32(__FILE__)); |
|
29 | + $stdIn = tempnam(sys_get_temp_dir(), 'stdin-'.crc32(__FILE__)); |
|
30 | 30 | $this->bind()->annotatedWith(StdIn::class)->toInstance($stdIn); |
31 | 31 | } |
32 | 32 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | private function getParams($method, array $server, array $post) : array |
90 | 90 | { |
91 | 91 | // post data exists |
92 | - if ($method === 'post' && ! empty($post)) { |
|
92 | + if ($method === 'post' && !empty($post)) { |
|
93 | 93 | return $post; |
94 | 94 | } |
95 | 95 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return $put; |
114 | 114 | } |
115 | 115 | $isApplicationJson = strpos($contentType, self::APPLICATION_JSON) !== false; |
116 | - if (! $isApplicationJson) { |
|
116 | + if (!$isApplicationJson) { |
|
117 | 117 | return []; |
118 | 118 | } |
119 | 119 | $content = json_decode($this->getRawBody($server), true); |