Passed
Push — analysis-L3BKMk ( 952340 )
by Arnaud
05:47
created
src/Generator/Pagination.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         }
30 30
 
31 31
         // filters pages: home, sections and terms
32
-        $filteredPages = $this->pagesCollection->filter(function (Page $page) {
32
+        $filteredPages = $this->pagesCollection->filter(function(Page $page) {
33 33
             return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]);
34 34
         });
35 35
         /** @var Page $page */
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->pagesCollection->filter(function (Page $page) {
26
+        $subPages = $this->pagesCollection->filter(function(Page $page) {
27 27
             return $page->getType() == TYPE::PAGE
28 28
                 && $page->getId() != 'index'; // excludes homepage
29 29
         });
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     public function setMessageCallback(\Closure $messageCallback = null): void
286 286
     {
287 287
         if ($messageCallback === null) {
288
-            $messageCallback = function ($code, $message = '', $itemsCount = 0, $itemsMax = 0) {
288
+            $messageCallback = function($code, $message = '', $itemsCount = 0, $itemsMax = 0) {
289 289
                 switch ($code) {
290 290
                     case 'CONFIG':
291 291
                     case 'LOCATE':
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     public function getLog(int $type = 0): ?array
400 400
     {
401 401
         if (is_array($this->log)) {
402
-            return array_filter($this->log, function ($key) use ($type) {
402
+            return array_filter($this->log, function($key) use ($type) {
403 403
                 return $key['type'] <= $type;
404 404
             });
405 405
         }
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
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
126 126
     {
127
-        $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
127
+        $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) {
128 128
             $notVirtual = false;
129 129
             if (!$page->isVirtual()) {
130 130
                 $notVirtual = true;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function sortByWeight(\Traversable $collection): array
168 168
     {
169
-        $callback = function ($a, $b) {
169
+        $callback = function($a, $b) {
170 170
             if (!isset($a['weight'])) {
171 171
                 return 1;
172 172
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function sortByDate(\Traversable $collection): array
197 197
     {
198
-        $callback = function ($a, $b) {
198
+        $callback = function($a, $b) {
199 199
             if (!isset($a['date'])) {
200 200
                 return -1;
201 201
             }
Please login to merge, or discard this patch.
src/Step/PagesRender.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         // collects published pages
60 60
         /** @var Page $page */
61
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
61
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
62 62
             return !empty($page->getVariable('published'));
63 63
         });
64 64
         $max = count($filteredPages);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         }
286 286
         $rendered = preg_replace_callback(
287 287
             '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
288
-            function ($matches) use ($replace) {
288
+            function($matches) use ($replace) {
289 289
                 return \sprintf($replace, Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? '');
290 290
             },
291 291
             $rendered
Please login to merge, or discard this patch.
src/Step/PagesSave.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         call_user_func_array($this->builder->getMessageCb(), ['SAVE', 'Saving pages']);
48 48
 
49 49
         /** @var Page $page */
50
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
50
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
51 51
             return !empty($page->getVariable('rendered'));
52 52
         });
53 53
         $max = count($filteredPages);
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
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             call_user_func_array($this->builder->getMessageCb(), ['GENERATE', 'Generating pages']);
40 40
 
41 41
             // loads local generators
42
-            spl_autoload_register(function ($className) {
42
+            spl_autoload_register(function($className) {
43 43
                 $generatorFile = $this->config->getDestinationDir().'/generators/'.$className.'.php';
44 44
                 if (file_exists($generatorFile)) {
45 45
                     require $generatorFile;
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             });
48 48
 
49 49
             $generators = (array) $this->builder->getConfig()->get('generators');
50
-            array_walk($generators, function ($generator, $priority) use ($generatorManager) {
50
+            array_walk($generators, function($generator, $priority) use ($generatorManager) {
51 51
                 if (!class_exists($generator)) {
52 52
                     $message = sprintf('Unable to load generator "%s"', $generator);
53 53
                     call_user_func_array($this->builder->getMessageCb(), ['GENERATE_ERROR', $message]);
Please login to merge, or discard this patch.
src/Command/Command.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@
 block discarded – undo
188 188
      */
189 189
     public function messageCallback(OutputInterface $output): \Closure
190 190
     {
191
-        return function ($code, $message = '', $itemsCount = 0, $itemsMax = 0) use ($output) {
191
+        return function($code, $message = '', $itemsCount = 0, $itemsMax = 0) use ($output) {
192 192
             if (strpos($code, '_PROGRESS') !== false) {
193 193
                 if ($output->isVerbose()) {
194 194
                     if ($itemsCount > 0) {
Please login to merge, or discard this patch.
src/Command/ShowContent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         $dataDir = (string) $this->getBuilder($output)->getConfig()->get('data.dir');
48 48
 
49 49
         // formating output
50
-        $unicodeTreePrefix = function (RecursiveTreeIterator $tree) {
50
+        $unicodeTreePrefix = function(RecursiveTreeIterator $tree) {
51 51
             $prefixParts = [
52 52
                 RecursiveTreeIterator::PREFIX_LEFT         => ' ',
53 53
                 RecursiveTreeIterator::PREFIX_MID_HAS_NEXT => '│ ',
Please login to merge, or discard this patch.