Passed
Push — code ( 21ce61 )
by Arnaud
03:35
created
src/Step/PagesGenerate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $generatorManager = new GeneratorManager($this->builder);
46 46
 
47 47
         // loads local generators
48
-        spl_autoload_register(function ($className) {
48
+        spl_autoload_register(function($className) {
49 49
             $generatorFile = Util::joinFile($this->config->getSourceDir(), 'generators', "$className.php");
50 50
             if (file_exists($generatorFile)) {
51 51
                 require $generatorFile;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         });
54 54
 
55 55
         $generators = (array) $this->builder->getConfig()->get('generators');
56
-        array_walk($generators, function ($generator, $priority) use ($generatorManager) {
56
+        array_walk($generators, function($generator, $priority) use ($generatorManager) {
57 57
             if (!class_exists($generator)) {
58 58
                 $message = sprintf('Unable to load generator "%s"', $generator);
59 59
                 $this->builder->getLogger()->error($message);
Please login to merge, or discard this patch.
src/Renderer/Layout.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,8 @@
 block discarded – undo
136 136
             case PageType::TERM:
137 137
                 $layouts = [
138 138
                     // "taxonomy/$term.$format.$ext", // ie: taxonomy/velo.html.twig
139
-                    "_default/term.$format.$ext",     // ie: _default/term.html.twig
140
-                    "_default/list.$format.$ext",     // ie: _default/list.html.twig
139
+                    "_default/term.$format.$ext", // ie: _default/term.html.twig
140
+                    "_default/list.$format.$ext", // ie: _default/list.html.twig
141 141
                 ];
142 142
                 if ($page->getVariable('term')) {
143 143
                     $layouts = array_merge(
Please login to merge, or discard this patch.
src/Generator/Homepage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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->isVirtual() === false // excludes virtual pages
29 29
                 && $page->getVariable('exclude') !== true;
Please login to merge, or discard this patch.
src/Generator/Pagination.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         }
30 30
 
31 31
         // filters pages: home, sections and terms
32
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
32
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
33 33
             return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]);
34 34
         });
35 35
         /** @var Page $page */
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                     $paginationPath = $pagePagination['path'];
59 59
                 }
60 60
             }
61
-            $pages = $pages->filter(function (Page $page) {
61
+            $pages = $pages->filter(function(Page $page) {
62 62
                 return $page->getVariable('published');
63 63
             });
64 64
             $pagesTotal = count($pages);
Please login to merge, or discard this patch.
src/Assets/Url.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
                         $this->url = new self($this->builder, $page, $options);
116 116
                         break;
117 117
                     // asset as string
118
-                    case false !== strpos($value, '.') ? true : false:
119
-                        $this->url = $base.'/'.ltrim($value, '/');
118
+                    case false !== strpos($value, '.') ? true : false : $this->url = $base.'/'.ltrim($value, '/');
120 119
                         break;
121 120
                     // others cases?
122 121
                     default:
Please login to merge, or discard this patch.
src/Generator/Section.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
                     /** @var \Cecil\Collection\Page\Page $page */
62 62
                     if ($page->hasVariable('cascade')) {
63 63
                         $cascade = $page->getVariable('cascade');
64
-                        $pages->map(function (Page $page) use ($cascade) {
64
+                        $pages->map(function(Page $page) use ($cascade) {
65 65
                             foreach ($cascade as $key => $value) {
66 66
                                 if (!$page->hasVariable($key)) {
67 67
                                     $page->setVariable($key, $value);
Please login to merge, or discard this patch.
src/Renderer/Site.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
      */
109 109
     public function getPages(): \Cecil\Collection\Page\Collection
110 110
     {
111
-        return $this->builder->getPages()->filter(function ($page) {
111
+        return $this->builder->getPages()->filter(function($page) {
112 112
             // We should fix case of virtual pages without language
113 113
             if ($page->getVariable('language') === null && $this->language === $this->config->getLanguageDefault()) {
114 114
                 return true;
Please login to merge, or discard this patch.
src/Util.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public static function joinPath(string ...$path): string
46 46
     {
47
-        $path = array_filter($path, function ($path) {
47
+        $path = array_filter($path, function($path) {
48 48
             return !empty($path) && !is_null($path);
49 49
         });
50
-        array_walk($path, function (&$value, $key) {
50
+        array_walk($path, function(&$value, $key) {
51 51
             $value = str_replace('\\', '/', $value);
52 52
             $value = rtrim($value, '/');
53 53
             $value = $key == 0 ? $value : ltrim($value, '/');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public static function joinFile(string ...$path): string
67 67
     {
68
-        array_walk($path, function (&$value, $key) use (&$path) {
68
+        array_walk($path, function(&$value, $key) use (&$path) {
69 69
             $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value);
70 70
             $value = rtrim($value, DIRECTORY_SEPARATOR);
71 71
             $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR);
Please login to merge, or discard this patch.
src/Step/PagesRender.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
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);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 // renders with Twig
133 133
                 try {
134 134
                     $deprecations = [];
135
-                    set_error_handler(function ($type, $msg) use (&$deprecations) {
135
+                    set_error_handler(function($type, $msg) use (&$deprecations) {
136 136
                         if (E_USER_DEPRECATED === $type) {
137 137
                             $deprecations[] = $msg;
138 138
                         }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     protected function getTranslations(Page $refPage): \Cecil\Collection\Page\Collection
284 284
     {
285 285
         /** @var Page $page */
286
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) use ($refPage) {
286
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) use ($refPage) {
287 287
             return $page->getId() !== $refPage->getId()
288 288
                 && $page->getVariable('langref') == $refPage->getVariable('langref')
289 289
                 && $page->getType() == $refPage->getType()
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                 // add generator meta tag
311 311
                 if (!preg_match('/<meta name="generator".*/i', $rendered)) {
312 312
                     $meta = \sprintf('<meta name="generator" content="Cecil %s" />', Builder::getVersion());
313
-                    $rendered = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function ($matches) use ($meta) {
313
+                    $rendered = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function($matches) use ($meta) {
314 314
                         return str_repeat($matches[1], 2).$meta."\n".$matches[1].$matches[2];
315 315
                     }, $rendered);
316 316
                 }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         }
330 330
         $rendered = preg_replace_callback(
331 331
             '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
332
-            function ($matches) use ($replace) {
332
+            function($matches) use ($replace) {
333 333
                 return \sprintf($replace, Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? '');
334 334
             },
335 335
             $rendered
Please login to merge, or discard this patch.