@@ -53,7 +53,7 @@ |
||
| 53 | 53 | public function process() |
| 54 | 54 | { |
| 55 | 55 | /** @var Page $page */ |
| 56 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 56 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 57 | 57 | return !empty($page->getVariable('rendered')); |
| 58 | 58 | }); |
| 59 | 59 | $max = count($filteredPages); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public static function joinPath(string ...$path): string |
| 132 | 132 | { |
| 133 | - array_walk($path, function (&$value, $key) { |
|
| 133 | + array_walk($path, function(&$value, $key) { |
|
| 134 | 134 | $value = str_replace('\\', '/', $value); |
| 135 | 135 | $value = rtrim($value, '/'); |
| 136 | 136 | $value = $key == 0 ? $value : ltrim($value, '/'); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public static function joinFile(string ...$path): string |
| 150 | 150 | { |
| 151 | - array_walk($path, function (&$value, $key) use (&$path) { |
|
| 151 | + array_walk($path, function(&$value, $key) use (&$path) { |
|
| 152 | 152 | $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value); |
| 153 | 153 | $value = rtrim($value, DIRECTORY_SEPARATOR); |
| 154 | 154 | $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | public static function fileGetContents($filename) |
| 218 | 218 | { |
| 219 | 219 | set_error_handler( |
| 220 | - function ($severity, $message, $file, $line) { |
|
| 220 | + function($severity, $message, $file, $line) { |
|
| 221 | 221 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
| 222 | 222 | } |
| 223 | 223 | ); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | // creates an image object |
| 84 | 84 | try { |
| 85 | 85 | $img = ImageManager::make($source); |
| 86 | - $img->resize($this->size, null, function (\Intervention\Image\Constraint $constraint) { |
|
| 86 | + $img->resize($this->size, null, function(\Intervention\Image\Constraint $constraint) { |
|
| 87 | 87 | $constraint->aspectRatio(); |
| 88 | 88 | $constraint->upsize(); |
| 89 | 89 | }); |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | 'title' => '', |
| 14 | 14 | 'baseline' => '', |
| 15 | 15 | 'baseurl' => 'http://localhost:8000/', |
| 16 | - 'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl' |
|
| 16 | + 'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl' |
|
| 17 | 17 | 'description' => '', |
| 18 | - 'taxonomies' => [ // default taxonomies |
|
| 18 | + 'taxonomies' => [// default taxonomies |
|
| 19 | 19 | 'tags' => 'tag', // can be disabled with 'disabled' value |
| 20 | 20 | 'categories' => 'category', |
| 21 | 21 | ], |
| 22 | 22 | 'pagination' => [ |
| 23 | - 'max' => 5, // number of pages on each paginated pages |
|
| 23 | + 'max' => 5, // number of pages on each paginated pages |
|
| 24 | 24 | 'path' => 'page', // path to paginated pages. ie: '/blog/page/2/' |
| 25 | 25 | ], |
| 26 | 26 | 'date' => [ |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function generate(): void |
| 25 | 25 | { |
| 26 | - $subPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 26 | + $subPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 27 | 27 | return $page->getType() == TYPE::PAGE |
| 28 | 28 | && $page->getId() != 'index' // excludes homepage |
| 29 | 29 | && $page->isVirtual() === false; // excludes virtual pages |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | $buildProcess->setTty(Process::isTtySupported()); |
| 120 | 120 | $buildProcess->setPty(Process::isPtySupported()); |
| 121 | 121 | |
| 122 | - $processOutputCallback = function ($type, $data) use ($output) { |
|
| 122 | + $processOutputCallback = function($type, $data) use ($output) { |
|
| 123 | 123 | $output->write($data, false, OutputInterface::OUTPUT_RAW); |
| 124 | 124 | }; |
| 125 | 125 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | // collects published pages |
| 67 | 67 | /** @var Page $page */ |
| 68 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 68 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 69 | 69 | return !empty($page->getVariable('published')); |
| 70 | 70 | }); |
| 71 | 71 | $max = count($filteredPages); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | // renders with Twig |
| 131 | 131 | try { |
| 132 | 132 | $deprecations = []; |
| 133 | - set_error_handler(function ($type, $msg) use (&$deprecations) { |
|
| 133 | + set_error_handler(function($type, $msg) use (&$deprecations) { |
|
| 134 | 134 | if (E_USER_DEPRECATED === $type) { |
| 135 | 135 | $deprecations[] = $msg; |
| 136 | 136 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | // add generator meta tag |
| 292 | 292 | if (!preg_match('/<meta name="generator".*/i', $rendered)) { |
| 293 | 293 | $meta = \sprintf('<meta name="generator" content="Cecil %s" />', Builder::getVersion()); |
| 294 | - $rendered = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function ($matches) use ($meta) { |
|
| 294 | + $rendered = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function($matches) use ($meta) { |
|
| 295 | 295 | return str_repeat($matches[1], 2).$meta."\n".$matches[1].$matches[2]; |
| 296 | 296 | }, $rendered); |
| 297 | 297 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | $rendered = preg_replace_callback( |
| 312 | 312 | '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is', |
| 313 | - function ($matches) use ($replace) { |
|
| 313 | + function($matches) use ($replace) { |
|
| 314 | 314 | return \sprintf($replace, Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? ''); |
| 315 | 315 | }, |
| 316 | 316 | $rendered |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function all(): self |
| 26 | 26 | { |
| 27 | - $filteredPages = $this->filter(function (Page $page) { |
|
| 27 | + $filteredPages = $this->filter(function(Page $page) { |
|
| 28 | 28 | if ($page->isVirtual() === false) { |
| 29 | 29 | return true; |
| 30 | 30 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function sortByDate(): self |
| 42 | 42 | { |
| 43 | - return $this->usort(function ($a, $b) { |
|
| 43 | + return $this->usort(function($a, $b) { |
|
| 44 | 44 | if ($a['date'] == $b['date']) { |
| 45 | 45 | return 0; |
| 46 | 46 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function sortByTitle(): self |
| 58 | 58 | { |
| 59 | - return $this->usort(function ($a, $b) { |
|
| 59 | + return $this->usort(function($a, $b) { |
|
| 60 | 60 | return strnatcmp($a['title'], $b['title']); |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function sortByWeight(): self |
| 70 | 70 | { |
| 71 | - return $this->usort(function ($a, $b) { |
|
| 71 | + return $this->usort(function($a, $b) { |
|
| 72 | 72 | if ($a['weight'] == $b['weight']) { |
| 73 | 73 | return 0; |
| 74 | 74 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function sortByDate(): self |
| 54 | 54 | { |
| 55 | - return $this->usort(function ($a, $b) { |
|
| 55 | + return $this->usort(function($a, $b) { |
|
| 56 | 56 | if ($a['date'] == $b['date']) { |
| 57 | 57 | return 0; |
| 58 | 58 | } |