Passed
Push — fix/published ( 8e7794...bc499f )
by Arnaud
11:41 queued 06:45
created
src/Step/PagesRender.php 1 patch
Spacing   +4 added lines, -4 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);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Collection/Taxonomy/Term.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Renderer/Twig/Extension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
202 202
     {
203
-        $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
203
+        $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) {
204 204
             $notVirtual = false;
205 205
             if (!$page->isVirtual()) {
206 206
                 $notVirtual = true;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     public function sortByWeight(\Traversable $collection): array
244 244
     {
245
-        $callback = function ($a, $b) {
245
+        $callback = function($a, $b) {
246 246
             if (!isset($a['weight'])) {
247 247
                 $a['weight'] = 0;
248 248
             }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     public function sortByDate(\Traversable $collection): array
273 273
     {
274
-        $callback = function ($a, $b) {
274
+        $callback = function($a, $b) {
275 275
             if ($a['date'] == $b['date']) {
276 276
                 return 0;
277 277
             }
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
@@ -105,8 +105,7 @@
 block discarded – undo
105 105
                         $this->url = $value;
106 106
                         break;
107 107
                     // asset as string
108
-                    case false !== strpos($value, '.') ? true : false :
109
-                        $this->url = $base.'/'.ltrim($value, '/');
108
+                    case false !== strpos($value, '.') ? true : false : $this->url = $base.'/'.ltrim($value, '/');
110 109
                         break;
111 110
                     // Page ID as string
112 111
                     case $this->builder->getPages()->has($pageId):
Please login to merge, or discard this patch.
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/Generator/Section.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 // cascade
56 56
                 if ($page->hasVariable('cascade')) {
57 57
                     $cascade = $page->getVariable('cascade');
58
-                    $pages->map(function (Page $page) use ($cascade) {
58
+                    $pages->map(function(Page $page) use ($cascade) {
59 59
                         foreach ($cascade as $key => $value) {
60 60
                             if (!$page->hasVariable($key)) {
61 61
                                 $page->setVariable($key, $value);
Please login to merge, or discard this patch.
src/Util.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public static function joinPath(string ...$path): string
46 46
     {
47
-        array_walk($path, function (&$value, $key) {
47
+        array_walk($path, function(&$value, $key) {
48 48
             $value = str_replace('\\', '/', $value);
49 49
             $value = rtrim($value, '/');
50 50
             $value = $key == 0 ? $value : ltrim($value, '/');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public static function joinFile(string ...$path): string
64 64
     {
65
-        array_walk($path, function (&$value, $key) use (&$path) {
65
+        array_walk($path, function(&$value, $key) use (&$path) {
66 66
             $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value);
67 67
             $value = rtrim($value, DIRECTORY_SEPARATOR);
68 68
             $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR);
Please login to merge, or discard this patch.
src/Util/File.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     public static function fileGetContents($filename, $userAgent = false)
43 43
     {
44 44
         set_error_handler(
45
-            function ($severity, $message, $file, $line) {
45
+            function($severity, $message, $file, $line) {
46 46
                 throw new \ErrorException($message, 0, $severity, $file, $line, null);
47 47
             }
48 48
         );
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.