@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $this->port = $port; |
| 69 | 69 | |
| 70 | - $this->reactHttpServer->on('request', function (Request $request, Response $response) { |
|
| 71 | - $path = $this->configuration->getOutputDirectory() . '/' . ltrim(rawurldecode($request->getPath()), '/'); |
|
| 70 | + $this->reactHttpServer->on('request', function(Request $request, Response $response) { |
|
| 71 | + $path = $this->configuration->getOutputDirectory().'/'.ltrim(rawurldecode($request->getPath()), '/'); |
|
| 72 | 72 | if (is_dir($path)) { |
| 73 | 73 | $path .= '/index.html'; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (! file_exists($path)) { |
|
| 76 | + if (!file_exists($path)) { |
|
| 77 | 77 | $this->responseWriter->send404Response($request, $response); |
| 78 | 78 | } else { |
| 79 | 79 | $this->responseWriter->send200Response($request, $response, $path); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ]); |
| 41 | 41 | |
| 42 | 42 | $response->end( |
| 43 | - '<h1>404 - Not Found</h1>' . |
|
| 43 | + '<h1>404 - Not Found</h1>'. |
|
| 44 | 44 | '<p>Sculpin web server could not find the requested resource.</p>' |
| 45 | 45 | ); |
| 46 | 46 | } |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | $wrapClose = '</error>'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - return $wrapOpen . $message . $wrapClose; |
|
| 78 | + return $wrapOpen.$message.$wrapClose; |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | private function ensurePathStartsWithDate(SplFileInfo $fileInfo) |
| 93 | 93 | { |
| 94 | - if (! PathAnalyzer::startsWithDate($fileInfo)) { |
|
| 94 | + if (!PathAnalyzer::startsWithDate($fileInfo)) { |
|
| 95 | 95 | throw new Exception( |
| 96 | 96 | 'Post name has to start with a date in "Y-m-d" format. E.g. "2016-01-01-name.md".' |
| 97 | 97 | ); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function getBaseName() : string |
| 74 | 74 | { |
| 75 | - return $this->fileInfo->getBasename('.' . $this->fileInfo->getExtension()); |
|
| 75 | + return $this->fileInfo->getBasename('.'.$this->fileInfo->getExtension()); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function getPrimaryExtension() : string |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | // 3. trim left-over {layout tag}, probably bug-fix |
| 70 | 70 | if ($file instanceof PostFile) { |
| 71 | - $htmlContent = preg_replace("/{[^)]+}/","",$htmlContent); |
|
| 71 | + $htmlContent = preg_replace("/{[^)]+}/", "", $htmlContent); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $file->changeContent($htmlContent); |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | private function prependLayoutToFileContent(AbstractFile $file) |
| 85 | 85 | { |
| 86 | - if ( ! $file->getLayout()) { |
|
| 86 | + if (!$file->getLayout()) { |
|
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $layoutLine = sprintf('{layout "%s"}', $file->getLayout()); |
| 91 | - $file->changeContent($layoutLine . PHP_EOL . PHP_EOL . $file->getContent()); |
|
| 91 | + $file->changeContent($layoutLine.PHP_EOL.PHP_EOL.$file->getContent()); |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | private function setConfigurationToFileIfFoundAny(string $content, AbstractFile $file) |
| 37 | 37 | { |
| 38 | - if (! preg_match('/^(\s*[-]+\s*|\s*)$/', $content)) { |
|
| 38 | + if (!preg_match('/^(\s*[-]+\s*|\s*)$/', $content)) { |
|
| 39 | 39 | $configuration = $this->yamlAndNeonParser->decode($content); |
| 40 | 40 | $file->setConfiguration($configuration); |
| 41 | 41 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $file->setOutputPath($file->getBaseName() . DIRECTORY_SEPARATOR . 'index.html'); |
|
| 38 | + $file->setOutputPath($file->getBaseName().DIRECTORY_SEPARATOR.'index.html'); |
|
| 39 | 39 | $file->setRelativeUrl($file->getBaseName()); |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function buildOutputPath(AbstractFile $file) : string |
| 39 | 39 | { |
| 40 | - return PathNormalizer::normalize($this->buildRelativeUrl($file) . '/index.html'); |
|
| 40 | + return PathNormalizer::normalize($this->buildRelativeUrl($file).'/index.html'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of Symplify |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return $file->getBaseName(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - return $file->getBaseName() . '.' . $file->getPrimaryExtension(); |
|
| 31 | + return $file->getBaseName().'.'.$file->getPrimaryExtension(); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function buildRelativeUrl(AbstractFile $file) : string |