@@ -132,7 +132,7 @@ |
||
132 | 132 | $buildProcess->setPty(Process::isPtySupported()); |
133 | 133 | $buildProcess->setTimeout(3600 * 2); // timeout = 2 minutes |
134 | 134 | |
135 | - $processOutputCallback = function ($type, $data) use ($output) { |
|
135 | + $processOutputCallback = function($type, $data) use ($output) { |
|
136 | 136 | $output->write($data, false, OutputInterface::OUTPUT_RAW); |
137 | 137 | }; |
138 | 138 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | foreach ($files as $file) { |
68 | 68 | $count++; |
69 | 69 | set_error_handler( |
70 | - function ($severity, $message, $file, $line) { |
|
70 | + function($severity, $message, $file, $line) { |
|
71 | 71 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
72 | 72 | } |
73 | 73 | ); |
@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | protected function collectPages(): void |
148 | 148 | { |
149 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
149 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
150 | 150 | return $page->hasVariable('menu') |
151 | 151 | && $page->getVariable('published') |
152 | 152 | && in_array($page->getVariable('language', $this->config->getLanguageDefault()), array_column($this->config->getLanguages(), 'code')); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->generate(); |
51 | 51 | |
52 | 52 | // set default language (e.g.: "en") if necessary |
53 | - $this->generatedPages->map(function (\Cecil\Collection\Page\Page $page) { |
|
53 | + $this->generatedPages->map(function(\Cecil\Collection\Page\Page $page) { |
|
54 | 54 | if ($page->getVariable('language') === null) { |
55 | 55 | $page->setVariable('language', $this->config->getLanguageDefault()); |
56 | 56 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | */ |
137 | 137 | public function getPages(): \Cecil\Collection\Page\Collection |
138 | 138 | { |
139 | - return $this->builder->getPages()->filter(function (CollectionPage $page) { |
|
139 | + return $this->builder->getPages()->filter(function(CollectionPage $page) { |
|
140 | 140 | // We should fix case of virtual pages without language |
141 | 141 | if ($page->getVariable('language') === null && $this->language == $this->config->getLanguageDefault()) { |
142 | 142 | return true; |
@@ -100,10 +100,10 @@ |
||
100 | 100 | $this->builder->getLogger()->debug('Intl extension is loaded'); |
101 | 101 | } |
102 | 102 | // filters fallback |
103 | - $this->twig->registerUndefinedFilterCallback(function ($name) { |
|
103 | + $this->twig->registerUndefinedFilterCallback(function($name) { |
|
104 | 104 | switch ($name) { |
105 | 105 | case 'localizeddate': |
106 | - return new \Twig\TwigFilter($name, function (\DateTime $value = null) { |
|
106 | + return new \Twig\TwigFilter($name, function(\DateTime $value = null) { |
|
107 | 107 | return date((string) $this->builder->getConfig()->get('date.format'), $value->getTimestamp()); |
108 | 108 | }); |
109 | 109 | } |
@@ -61,8 +61,8 @@ |
||
61 | 61 | |
62 | 62 | // handles options |
63 | 63 | $canonical = null; // if true, add prefix URL with baseurl |
64 | - $format = null; // set output format |
|
65 | - $language = null; // force language |
|
64 | + $format = null; // set output format |
|
65 | + $language = null; // force language |
|
66 | 66 | extract(is_array($options) ? $options : [], EXTR_IF_EXISTS); |
67 | 67 | |
68 | 68 | // canonical URL? |
@@ -50,7 +50,7 @@ |
||
50 | 50 | Util::autoload($this->builder, 'generators'); |
51 | 51 | |
52 | 52 | $generators = (array) $this->builder->getConfig()->get('generators'); |
53 | - array_walk($generators, function ($generator, $priority) use ($generatorManager) { |
|
53 | + array_walk($generators, function($generator, $priority) use ($generatorManager) { |
|
54 | 54 | if (!class_exists($generator)) { |
55 | 55 | $message = \sprintf('Unable to load generator "%s".', $generator); |
56 | 56 | $this->builder->getLogger()->error($message); |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function joinPath(string ...$path): string |
42 | 42 | { |
43 | - $path = array_filter($path, function ($path) { |
|
43 | + $path = array_filter($path, function($path) { |
|
44 | 44 | return !empty($path) && !is_null($path); |
45 | 45 | }); |
46 | - array_walk($path, function (&$value, $key) { |
|
46 | + array_walk($path, function(&$value, $key) { |
|
47 | 47 | $value = str_replace('\\', '/', $value); |
48 | 48 | $value = rtrim($value, '/'); |
49 | 49 | $value = $key == 0 ? $value : ltrim($value, '/'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public static function joinFile(string ...$path): string |
59 | 59 | { |
60 | - array_walk($path, function (&$value, $key) use (&$path) { |
|
60 | + array_walk($path, function(&$value, $key) use (&$path) { |
|
61 | 61 | $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value); |
62 | 62 | $value = rtrim($value, DIRECTORY_SEPARATOR); |
63 | 63 | $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public static function autoload(Builder $builder, string $dir): void |
87 | 87 | { |
88 | - spl_autoload_register(function ($className) use ($builder, $dir) { |
|
88 | + spl_autoload_register(function($className) use ($builder, $dir) { |
|
89 | 89 | $classFile = Util::joinFile($builder->getConfig()->getSourceDir(), $dir, "$className.php"); |
90 | 90 | if (file_exists($classFile)) { |
91 | 91 | require $classFile; |