@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * |
| 115 | 115 | * @return null|string |
| 116 | 116 | */ |
| 117 | - private function cleanCacheDir(string $cacheDir) : ?string { |
|
| 117 | + private function cleanCacheDir(string $cacheDir) : ? string { |
|
| 118 | 118 | if (!$this->fs->exists($cacheDir)) { |
| 119 | 119 | return ''; |
| 120 | 120 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $entries = $this->getData($page->getVariable($variable)); |
| 43 | 43 | |
| 44 | 44 | foreach ($filters as $field => $value) { |
| 45 | - $entries = array_filter($entries, function ($entry) use ($field, $value) { |
|
| 45 | + $entries = array_filter($entries, function($entry) use ($field, $value) { |
|
| 46 | 46 | return isset($entry[$field]) && $entry[$field] == $value; |
| 47 | 47 | }); |
| 48 | 48 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $entries = $this->getData($page->getVariable($variable)); |
| 54 | 54 | |
| 55 | - uasort($entries, function ($a, $b) use ($field) { |
|
| 55 | + uasort($entries, function($a, $b) use ($field) { |
|
| 56 | 56 | return strcmp($a[$field], $b[$field]); |
| 57 | 57 | }); |
| 58 | 58 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * @throws ConfigurationException |
| 77 | 77 | */ |
| 78 | - private function validateConfig(?array $config) { |
|
| 78 | + private function validateConfig(? array $config) { |
|
| 79 | 79 | if (!isset($config['field'])) { |
| 80 | 80 | throw ConfigurationException::requiredAdapterOptions(AdapterFactory::ORDER_ADAPTER, 'field'); |
| 81 | 81 | } |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | 'cache' => false, |
| 36 | 36 | ]); |
| 37 | 37 | |
| 38 | - $this->addFunction(new \Twig_SimpleFunction('meta', [$templatePlugin, 'meta'], ['is_safe' => ['html'],])); |
|
| 39 | - $this->addFunction(new \Twig_SimpleFunction('css', [$templatePlugin, 'css'], ['is_safe' => ['html'],])); |
|
| 40 | - $this->addFunction(new \Twig_SimpleFunction('js', [$templatePlugin, 'js'], ['is_safe' => ['html'],])); |
|
| 38 | + $this->addFunction(new \Twig_SimpleFunction('meta', [$templatePlugin, 'meta'], ['is_safe' => ['html'], ])); |
|
| 39 | + $this->addFunction(new \Twig_SimpleFunction('css', [$templatePlugin, 'css'], ['is_safe' => ['html'], ])); |
|
| 40 | + $this->addFunction(new \Twig_SimpleFunction('js', [$templatePlugin, 'js'], ['is_safe' => ['html'], ])); |
|
| 41 | 41 | $this->addFunction(new \Twig_SimpleFunction('image', [$templatePlugin, 'image'])); |
| 42 | 42 | $this->addFunction(new \Twig_SimpleFunction('file', [$templatePlugin, 'file'])); |
| 43 | 43 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * @param string $templateDir |
| 18 | 18 | * @param string $cacheDir |
| 19 | 19 | */ |
| 20 | - public function __construct(?string $templateDir = './src', ?string $cacheDir = './.cache') { |
|
| 20 | + public function __construct(? string $templateDir = './src', ? string $cacheDir = './.cache') { |
|
| 21 | 21 | parent::__construct(); |
| 22 | 22 | |
| 23 | 23 | $this->addTemplateDir($templateDir); |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | /** |
| 52 | 52 | * @return HeaderCompiler|null |
| 53 | 53 | */ |
| 54 | - public function getHeaderCompilerByEnvironment() : ?HeaderCompiler { |
|
| 54 | + public function getHeaderCompilerByEnvironment() : ? HeaderCompiler { |
|
| 55 | 55 | return $this->headerCompilers[$this->environment] ?? null; |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -35,35 +35,35 @@ discard block |
||
| 35 | 35 | public function __construct(ContainerInterface $container) { |
| 36 | 36 | $this->container = $container; |
| 37 | 37 | |
| 38 | - self::addTypeFilter(self::EXTENSION_FOLDER, function ($fileName) { |
|
| 38 | + self::addTypeFilter(self::EXTENSION_FOLDER, function($fileName) { |
|
| 39 | 39 | return strpos($fileName, '/') === strlen($fileName) - 1; |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - self::addTypeFilter(self::EXTENSION_JSON, function ($fileName) { |
|
| 42 | + self::addTypeFilter(self::EXTENSION_JSON, function($fileName) { |
|
| 43 | 43 | return strpos($fileName, '.json') === strlen($fileName) - 5; |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - self::addTypeFilter(self::EXTENSION_MD, function ($fileName) { |
|
| 46 | + self::addTypeFilter(self::EXTENSION_MD, function($fileName) { |
|
| 47 | 47 | return strpos($fileName, '.md') !== false; |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - self::addTypeFilter(self::EXTENSION_YML, function ($fileName) { |
|
| 50 | + self::addTypeFilter(self::EXTENSION_YML, function($fileName) { |
|
| 51 | 51 | return strpos($fileName, '.yaml') !== false || strpos($fileName, '.yml') !== false; |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - self::addTypeFilter(self::EXTENSION_IMG, function ($fileName) { |
|
| 54 | + self::addTypeFilter(self::EXTENSION_IMG, function($fileName) { |
|
| 55 | 55 | return strpos($fileName, '.jpg') !== false || strpos($fileName, '.png') !== false; |
| 56 | 56 | }); |
| 57 | 57 | |
| 58 | - self::addTypeFilter(self::EXTENSION_CSS, function ($fileName) { |
|
| 58 | + self::addTypeFilter(self::EXTENSION_CSS, function($fileName) { |
|
| 59 | 59 | return strpos($fileName, '.css') !== false; |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | - self::addTypeFilter(self::EXTENSION_JS, function ($fileName) { |
|
| 62 | + self::addTypeFilter(self::EXTENSION_JS, function($fileName) { |
|
| 63 | 63 | return strpos($fileName, '.js') === strlen($fileName) - 3; |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - self::addTypeFilter(self::EXTENSION_SASS, function ($fileName) { |
|
| 66 | + self::addTypeFilter(self::EXTENSION_SASS, function($fileName) { |
|
| 67 | 67 | return strpos($fileName, '.scss') !== false || strpos($fileName, '.sass') !== false; |
| 68 | 68 | }); |
| 69 | 69 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @return Parser|null |
| 83 | 83 | */ |
| 84 | - public function getByFileName($fileName) : ?Parser { |
|
| 84 | + public function getByFileName($fileName) : ? Parser { |
|
| 85 | 85 | if (!is_string($fileName)) { |
| 86 | 86 | return null; |
| 87 | 87 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * |
| 43 | 43 | * @return null|SplFileInfo |
| 44 | 44 | */ |
| 45 | - public static function getConfigFile(string $path) : ?SplFileInfo { |
|
| 45 | + public static function getConfigFile(string $path) : ? SplFileInfo { |
|
| 46 | 46 | $pathParts = explode('/', $path); |
| 47 | 47 | $configFileName = array_pop($pathParts); |
| 48 | 48 | $configPath = implode('/', $pathParts) . '/'; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | * @param string $publicDir |
| 79 | 79 | * @param string $templateDir |
| 80 | 80 | */ |
| 81 | - private function __construct(?string $srcDir = './src', ?string $publicDir = './public', ?string $templateDir = './src/template') { |
|
| 81 | + private function __construct(? string $srcDir = './src', ? string $publicDir = './public', ? string $templateDir = './src/template') { |
|
| 82 | 82 | $this->srcDir = $srcDir; |
| 83 | 83 | $this->publicDir = $publicDir; |
| 84 | 84 | $this->templateDir = $templateDir; |