Passed
Push — alternates ( 031c47 )
by Arnaud
04:39
created
src/Step/Pages/Render.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 
65 65
         // collects published pages
66 66
         /** @var Page $page */
67
-        $pages = $this->builder->getPages()->filter(function (Page $page) {
67
+        $pages = $this->builder->getPages()->filter(function(Page $page) {
68 68
             return !empty($page->getVariable('published'));
69 69
         });
70 70
         $max = count($pages);
71 71
 
72 72
         // enrichs some variables
73
-        $pages = $this->builder->getPages()->map(function (Page $page) {
73
+        $pages = $this->builder->getPages()->map(function(Page $page) {
74 74
             $formats = $this->getOutputFormats($page);
75 75
             // set output formats
76 76
             $page->setVariable('output', $formats);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 // renders with Twig
125 125
                 try {
126 126
                     $deprecations = [];
127
-                    set_error_handler(function ($type, $msg) use (&$deprecations) {
127
+                    set_error_handler(function($type, $msg) use (&$deprecations) {
128 128
                         if (E_USER_DEPRECATED === $type) {
129 129
                             $deprecations[] = $msg;
130 130
                         }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     protected function getTranslations(Page $refPage): \Cecil\Collection\Page\Collection
274 274
     {
275 275
         /** @var Page $page */
276
-        $pages = $this->builder->getPages()->filter(function (Page $page) use ($refPage) {
276
+        $pages = $this->builder->getPages()->filter(function(Page $page) use ($refPage) {
277 277
             return $page->getId() !== $refPage->getId()
278 278
                 && $page->getVariable('langref') == $refPage->getVariable('langref')
279 279
                 && $page->getType() == $refPage->getType()
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 // add generator meta tag
295 295
                 if (!preg_match('/<meta name="generator".*/i', $output)) {
296 296
                     $meta = \sprintf('<meta name="generator" content="Cecil %s" />', Builder::getVersion());
297
-                    $output = preg_replace_callback('/([[:blank:]]*)(<\/head>)/i', function ($matches) use ($meta) {
297
+                    $output = preg_replace_callback('/([[:blank:]]*)(<\/head>)/i', function($matches) use ($meta) {
298 298
                         return str_repeat($matches[1] ?: ' ', 2).$meta."\n".$matches[1].$matches[2];
299 299
                     }, $output);
300 300
                 }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             //'/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
313 313
             // https://regex101.com/r/ycWMe4/1
314 314
             '/href="(\/|)([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
315
-            function ($matches) use ($page) {
315
+            function($matches) use ($page) {
316 316
                 // section spage
317 317
                 $hrefPattern = 'href="../%s/%s"';
318 318
                 // root page
Please login to merge, or discard this patch.