@@ -37,11 +37,11 @@ |
||
| 37 | 37 | $output = $isModified ? $this->getOutput($ro, $server) : $this->condResponse->getOutput($ro->headers); |
| 38 | 38 | |
| 39 | 39 | $statusText = (new Code())->statusText[$ro->code] ?? ''; |
| 40 | - $ob = $output->code . ' ' . $statusText . PHP_EOL; |
|
| 40 | + $ob = $output->code.' '.$statusText.PHP_EOL; |
|
| 41 | 41 | |
| 42 | 42 | // header |
| 43 | 43 | foreach ($output->headers as $label => $value) { |
| 44 | - $ob .= "{$label}: {$value}" . PHP_EOL; |
|
| 44 | + $ob .= "{$label}: {$value}".PHP_EOL; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // empty line |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function toString(): string |
| 30 | 30 | { |
| 31 | - $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL; |
|
| 31 | + $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL; |
|
| 32 | 32 | |
| 33 | 33 | return $this->view; |
| 34 | 34 | } |
@@ -39,12 +39,12 @@ |
||
| 39 | 39 | |
| 40 | 40 | private function installContextModule(AbstractAppMeta $appMeta, string $contextItem, AbstractModule $module): AbstractModule |
| 41 | 41 | { |
| 42 | - $class = $appMeta->name . '\Module\\' . ucwords($contextItem) . 'Module'; |
|
| 43 | - if (! class_exists($class)) { |
|
| 44 | - $class = 'BEAR\Package\Context\\' . ucwords($contextItem) . 'Module'; |
|
| 42 | + $class = $appMeta->name.'\Module\\'.ucwords($contextItem).'Module'; |
|
| 43 | + if (!class_exists($class)) { |
|
| 44 | + $class = 'BEAR\Package\Context\\'.ucwords($contextItem).'Module'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if (! is_a($class, AbstractModule::class, true)) { |
|
| 47 | + if (!is_a($class, AbstractModule::class, true)) { |
|
| 48 | 48 | throw new InvalidContextException($contextItem); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function __invoke(string $interface, string $name = ''): void |
| 36 | 36 | { |
| 37 | - $dependencyIndex = $interface . '-' . $name; |
|
| 37 | + $dependencyIndex = $interface.'-'.$name; |
|
| 38 | 38 | if (in_array($dependencyIndex, $this->compiled, true)) { |
| 39 | 39 | // @codeCoverageIgnoreStart |
| 40 | 40 | printf("S %s:%s\n", $interface, $name); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $class = new ReflectionClass($className); |
| 32 | 32 | $instance = $class->newInstanceWithoutConstructor(); |
| 33 | - if (! $instance instanceof $className) { |
|
| 33 | + if (!$instance instanceof $className) { |
|
| 34 | 34 | return; // @codeCoverageIgnore |
| 35 | 35 | } |
| 36 | 36 | |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | private function saveNamedParam(NamedParameterInterface $namedParameter, object $instance, string $method): void |
| 65 | 65 | { |
| 66 | 66 | // named parameter |
| 67 | - if (! in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) { |
|
| 68 | - return; // @codeCoverageIgnore |
|
| 67 | + if (!in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) { |
|
| 68 | + return; // @codeCoverageIgnore |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $callable = [$instance, $method]; |
| 72 | - if (! is_callable($callable)) { |
|
| 73 | - return; // @codeCoverageIgnore |
|
| 72 | + if (!is_callable($callable)) { |
|
| 73 | + return; // @codeCoverageIgnore |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | try { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | #[Named('namespace=cache_namespace')] |
| 25 | 25 | public function __construct(AbstractAppMeta $appMeta, string $namespace) |
| 26 | 26 | { |
| 27 | - $this->cacheDir = $appMeta->tmpDir . '/cache'; |
|
| 27 | + $this->cacheDir = $appMeta->tmpDir.'/cache'; |
|
| 28 | 28 | $this->namespace = $namespace; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function getFileInfo(string $filename): string |
| 82 | 82 | { |
| 83 | 83 | if (in_array($filename, (array) $this->overwritten, true)) { |
| 84 | - return $filename . ' (overwritten)'; |
|
| 84 | + return $filename.' (overwritten)'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return $filename; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | /** @var class-string $class */ |
| 123 | 123 | $filePath = (string) (new ReflectionClass($class))->getFileName(); |
| 124 | - if (! $this->isNotCompileFile($filePath)) { |
|
| 124 | + if (!$this->isNotCompileFile($filePath)) { |
|
| 125 | 125 | continue; // @codeCoverageIgnore |
| 126 | 126 | } |
| 127 | 127 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | %s |
| 152 | 152 | require __DIR__ . '/vendor/autoload.php'; |
| 153 | 153 | ", $this->context, $requiredFile); |
| 154 | - $fileName = realpath($appDir) . '/autoload.php'; |
|
| 154 | + $fileName = realpath($appDir).'/autoload.php'; |
|
| 155 | 155 | |
| 156 | 156 | ($this->filePutContents)($fileName, $autoloadFile); |
| 157 | 157 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | private function isNotAutoloadble(string $class): bool |
| 178 | 178 | { |
| 179 | - return ! class_exists($class, false) && ! interface_exists($class, false) && ! trait_exists($class, false); |
|
| 179 | + return !class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | private function isNotCompileFile(string $filePath): bool |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $dir = (string) realpath($rootDir); |
| 190 | 190 | if (strpos($file, $dir) !== false) { |
| 191 | - return (string) preg_replace('#^' . preg_quote($dir, '#') . '#', "__DIR__ . '", $file) . "'"; |
|
| 191 | + return (string) preg_replace('#^'.preg_quote($dir, '#').'#', "__DIR__ . '", $file)."'"; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return sprintf("'%s'", $file); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | opcache_compile_file( __DIR__ . '/vendor/autoload.php'); |
| 66 | 66 | |
| 67 | 67 | %s", $this->context, $requiredOnceFile); |
| 68 | - $fileName = realpath($appMeta->appDir) . '/preload.php'; |
|
| 68 | + $fileName = realpath($appMeta->appDir).'/preload.php'; |
|
| 69 | 69 | ($this->filePutContents)($fileName, $preloadFile); |
| 70 | 70 | |
| 71 | 71 | return $fileName; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function __invoke(string $appName, string $context, array $globals, array $server): int |
| 40 | 40 | { |
| 41 | - $injector = Injector::getInstance($appName, $context, $this->appDir); |
|
| 41 | + $injector = Injector::getInstance($appName, $context, $this->appDir); |
|
| 42 | 42 | $app = $injector->getInstance(AppInterface::class); |
| 43 | 43 | $injector->getInstance(HttpCacheInterface::class); |
| 44 | 44 | $router = $injector->getInstance(RouterInterface::class); |