@@ -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 |
@@ -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 | } |
@@ -52,6 +52,9 @@ |
||
52 | 52 | $this->async = $async; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param string $environment |
|
57 | + */ |
|
55 | 58 | public function setEnvironment($environment) { |
56 | 59 | $this->environment = $environment; |
57 | 60 | } |
@@ -2,11 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Pageon\Pcntl; |
4 | 4 | |
5 | -use Brendt\Stitcher\App; |
|
6 | 5 | use Brendt\Stitcher\Application\DevController; |
7 | 6 | use Brendt\Stitcher\Parser\Site\PageParser; |
8 | 7 | use Brendt\Stitcher\Site\Page; |
9 | -use Brendt\Stitcher\Site\Seo\SiteMap; |
|
10 | 8 | use Symfony\Component\Filesystem\Filesystem; |
11 | 9 | |
12 | 10 | class PageRenderProcess extends Process |
@@ -214,7 +214,7 @@ |
||
214 | 214 | $pageRenderProcess = new PageRenderProcess($this->pageParser, $page, $this->publicDir, $filterValue); |
215 | 215 | $pageRenderProcess->setEnvironment($this->environment); |
216 | 216 | |
217 | - $pageRenderProcess->onSuccess(function ($pageIds) use ($page) { |
|
217 | + $pageRenderProcess->onSuccess(function($pageIds) use ($page) { |
|
218 | 218 | if ($this->siteMap->isEnabled()) { |
219 | 219 | foreach ($pageIds as $pageId) { |
220 | 220 | $this->siteMap->addPath($pageId); |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Brendt\Stitcher\Factory\HeaderCompilerFactory; |
8 | 8 | use Brendt\Stitcher\Factory\ParserFactory; |
9 | 9 | use Brendt\Stitcher\Factory\TemplateEngineFactory; |
10 | -use Brendt\Stitcher\Site\Http\HeaderCompiler; |
|
11 | 10 | use Brendt\Stitcher\Site\Meta\MetaCompiler; |
12 | 11 | use Brendt\Stitcher\Site\Page; |
13 | 12 | use Brendt\Stitcher\Template\TemplatePlugin; |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Brendt\Stitcher\Site\Http; |
4 | 4 | |
5 | -use Brendt\Stitcher\Exception\ConfigurationException; |
|
6 | 5 | use Brendt\Stitcher\Site\Page; |
7 | 6 | use Symfony\Component\Filesystem\Filesystem; |
8 | 7 | use Tivie\HtaccessParser\HtaccessContainer; |
@@ -209,7 +209,7 @@ |
||
209 | 209 | $this->createConditionalRewrite($rewriteBlock, '%{DOCUMENT_ROOT}/$1.html -f', '^(.+?)/?$ /$1.html [L]'); |
210 | 210 | } |
211 | 211 | |
212 | - private function createConditionalRewrite(Block &$rewriteBlock, string $condition, string $rule) { |
|
212 | + private function createConditionalRewrite(Block & $rewriteBlock, string $condition, string $rule) { |
|
213 | 213 | $rewriteBlock->addLineBreak(1); |
214 | 214 | |
215 | 215 | $conditionLine = new Directive(); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $this->addCompiler('_name', [$this, 'compileNamedMeta']); |
25 | 25 | } |
26 | 26 | |
27 | - public function setDefaultMeta(Meta &$meta) { |
|
27 | + public function setDefaultMeta(Meta & $meta) { |
|
28 | 28 | foreach ($this->metaConfig as $name => $value) { |
29 | 29 | $meta->name($name, $value); |
30 | 30 | } |