@@ -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 | } |
@@ -38,35 +38,35 @@ |
||
| 38 | 38 | public function __construct(ContainerInterface $container) { |
| 39 | 39 | $this->container = $container; |
| 40 | 40 | |
| 41 | - self::addTypeFilter(self::EXTENSION_FOLDER, function ($fileName) { |
|
| 41 | + self::addTypeFilter(self::EXTENSION_FOLDER, function($fileName) { |
|
| 42 | 42 | return substr($fileName, -1) === '/'; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - self::addTypeFilter(self::EXTENSION_JSON, function ($fileName) { |
|
| 45 | + self::addTypeFilter(self::EXTENSION_JSON, function($fileName) { |
|
| 46 | 46 | return strpos($fileName, '.json') === strlen($fileName) - 5; |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | - self::addTypeFilter(self::EXTENSION_MD, function ($fileName) { |
|
| 49 | + self::addTypeFilter(self::EXTENSION_MD, function($fileName) { |
|
| 50 | 50 | return strpos($fileName, '.md') !== false; |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - self::addTypeFilter(self::EXTENSION_YML, function ($fileName) { |
|
| 53 | + self::addTypeFilter(self::EXTENSION_YML, function($fileName) { |
|
| 54 | 54 | return strpos($fileName, '.yaml') !== false || strpos($fileName, '.yml') !== false; |
| 55 | 55 | }); |
| 56 | 56 | |
| 57 | - self::addTypeFilter(self::EXTENSION_IMG, function ($fileName) { |
|
| 57 | + self::addTypeFilter(self::EXTENSION_IMG, function($fileName) { |
|
| 58 | 58 | return strpos($fileName, '.jpg') !== false || strpos($fileName, '.png') !== false; |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | - self::addTypeFilter(self::EXTENSION_CSS, function ($fileName) { |
|
| 61 | + self::addTypeFilter(self::EXTENSION_CSS, function($fileName) { |
|
| 62 | 62 | return strpos($fileName, '.css') !== false; |
| 63 | 63 | }); |
| 64 | 64 | |
| 65 | - self::addTypeFilter(self::EXTENSION_JS, function ($fileName) { |
|
| 65 | + self::addTypeFilter(self::EXTENSION_JS, function($fileName) { |
|
| 66 | 66 | return strpos($fileName, '.js') === strlen($fileName) - 3; |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - self::addTypeFilter(self::EXTENSION_SASS, function ($fileName) { |
|
| 69 | + self::addTypeFilter(self::EXTENSION_SASS, function($fileName) { |
|
| 70 | 70 | return strpos($fileName, '.scss') !== false || strpos($fileName, '.sass') !== false; |
| 71 | 71 | }); |
| 72 | 72 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | $entries = $this->getData($page->getVariable($variable)); |
| 55 | 55 | |
| 56 | - uasort($entries, function ($a, $b) use ($field) { |
|
| 56 | + uasort($entries, function($a, $b) use ($field) { |
|
| 57 | 57 | return strcmp($a[$field], $b[$field]); |
| 58 | 58 | }); |
| 59 | 59 | |
@@ -2,10 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Brendt\Stitcher\Plugin; |
| 4 | 4 | |
| 5 | -use Brendt\Stitcher\Exception\ConfigurationException; |
|
| 6 | -use Brendt\Stitcher\Exception\PluginException; |
|
| 7 | -use Symfony\Component\Finder\Finder; |
|
| 8 | -use Symfony\Component\Finder\SplFileInfo; |
|
| 9 | 5 | use Symfony\Component\Yaml\Yaml; |
| 10 | 6 | |
| 11 | 7 | class PluginConfiguration |
@@ -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 | } |
@@ -29,23 +29,23 @@ |
||
| 29 | 29 | public function __construct(ContainerInterface $container) { |
| 30 | 30 | $this->container = $container; |
| 31 | 31 | |
| 32 | - $this->addAdapter(self::COLLECTION_ADAPTER, function () { |
|
| 32 | + $this->addAdapter(self::COLLECTION_ADAPTER, function() { |
|
| 33 | 33 | return $this->container->get('adapter.collection'); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - $this->addAdapter(self::PAGINATION_ADAPTER, function () { |
|
| 36 | + $this->addAdapter(self::PAGINATION_ADAPTER, function() { |
|
| 37 | 37 | return $this->container->get('adapter.pagination'); |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | - $this->addAdapter(self::ORDER_ADAPTER, function () { |
|
| 40 | + $this->addAdapter(self::ORDER_ADAPTER, function() { |
|
| 41 | 41 | return $this->container->get('adapter.order'); |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | - $this->addAdapter(self::FILTER_ADAPTER, function () { |
|
| 44 | + $this->addAdapter(self::FILTER_ADAPTER, function() { |
|
| 45 | 45 | return $this->container->get('adapter.filter'); |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | - $this->addAdapter(self::LIMIT_ADAPTER, function () { |
|
| 48 | + $this->addAdapter(self::LIMIT_ADAPTER, function() { |
|
| 49 | 49 | return $this->container->get('adapter.limit'); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -273,7 +273,7 @@ |
||
| 273 | 273 | * @param string $condition |
| 274 | 274 | * @param string $rule |
| 275 | 275 | */ |
| 276 | - private function createConditionalRewrite(Block &$rewriteBlock, string $condition, string $rule) { |
|
| 276 | + private function createConditionalRewrite(Block & $rewriteBlock, string $condition, string $rule) { |
|
| 277 | 277 | $rewriteBlock->addLineBreak(1); |
| 278 | 278 | |
| 279 | 279 | $conditionLine = new Directive(); |