Passed
Push — fix/newpage ( 0b667d...549273 )
by Arnaud
17:58 queued 12:27
created
src/Collection/Page/Collection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function showable(): self
24 24
     {
25
-        $filteredPages = $this->filter(function (Page $page) {
25
+        $filteredPages = $this->filter(function(Page $page) {
26 26
             if ($page->getVariable('published') === true
27 27
                 && $page->isVirtual() === false
28 28
                 && $page->getVariable('redirect') === null
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function sortByDate(): self
51 51
     {
52
-        return $this->usort(function ($a, $b) {
52
+        return $this->usort(function($a, $b) {
53 53
             if ($a['date'] == $b['date']) {
54 54
                 return 0;
55 55
             }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function sortByTitle(): self
67 67
     {
68
-        return $this->usort(function ($a, $b) {
68
+        return $this->usort(function($a, $b) {
69 69
             return strnatcmp($a['title'], $b['title']);
70 70
         });
71 71
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function sortByWeight(): self
79 79
     {
80
-        return $this->usort(function ($a, $b) {
80
+        return $this->usort(function($a, $b) {
81 81
             if ($a['weight'] == $b['weight']) {
82 82
                 return 0;
83 83
             }
Please login to merge, or discard this patch.
src/Generator/AbstractGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     {
47 47
         $this->generate();
48 48
 
49
-        $this->generatedPages->map(function (\Cecil\Collection\Page\Page $page) {
49
+        $this->generatedPages->map(function(\Cecil\Collection\Page\Page $page) {
50 50
             if (!$page->hasVariable('language')) {
51 51
                 $page->setVariable('language', $this->config->getLanguageDefault());
52 52
             }
Please login to merge, or discard this patch.
src/Step/Taxonomies/Create.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
     protected function collectTermsFromPages(): void
94 94
     {
95 95
         /** @var Page $page */
96
-        $pages = $this->builder->getPages()->filter(function (Page $page) {
96
+        $pages = $this->builder->getPages()->filter(function(Page $page) {
97 97
             return $page->getVariable('published');
98 98
         })->sortByDate();
99 99
         foreach ($pages as $page) {
Please login to merge, or discard this patch.
src/Step/Content/DataLoad.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         foreach ($files as $file) {
68 68
             $count++;
69 69
             set_error_handler(
70
-                function ($severity, $message, $file, $line) {
70
+                function($severity, $message, $file, $line) {
71 71
                     throw new \ErrorException($message, 0, $severity, $file, $line, null);
72 72
                 }
73 73
             );
Please login to merge, or discard this patch.
src/Step/Menus/Create.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
      */
137 137
     protected function collectPages(): void
138 138
     {
139
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
139
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
140 140
             return $page->hasVariable('menu')
141 141
                 && $page->getVariable('published')
142 142
                 && in_array($page->getVariable('language') ?? $this->config->getLanguageDefault(), array_column($this->config->getLanguages(), 'code'));
Please login to merge, or discard this patch.
src/Step/Pages/Render.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.
src/Step/Pages/Save.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
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);
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
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
      */
105 105
     public function getPages(): \Cecil\Collection\Page\Collection
106 106
     {
107
-        return $this->builder->getPages()->filter(function (Page $page) {
107
+        return $this->builder->getPages()->filter(function(Page $page) {
108 108
             // We should fix case of virtual pages without language
109 109
             if ($page->getVariable('language') === null && $this->language === $this->config->getLanguageDefault()) {
110 110
                 return true;
Please login to merge, or discard this patch.
config/default.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
     'title'        => 'Site title',
14 14
     'baseline'     => 'Site 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'  => 'Site 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' => [
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
         'format' => 'yaml',
156 156
     ],
157 157
     'body' => [
158
-        'format' => 'md',         // only Markdown is supported
158
+        'format' => 'md', // only Markdown is supported
159 159
         'toc'    => ['h2', 'h3'], // list of headers to include in Table of contents
160 160
         'images' => [
161 161
             'lazy' => [
162
-                'enabled' => true,  // lazy load images
162
+                'enabled' => true, // lazy load images
163 163
             ],
164 164
             'caption' => [
165 165
                 'enabled' => false, // adds <figcaption> based on image title
@@ -200,17 +200,17 @@  discard block
 block discarded – undo
200 200
     ],
201 201
     'assets' => [
202 202
         'dir'     => 'assets',
203
-        'compile' => [     // Compile Saas
203
+        'compile' => [// Compile Saas
204 204
             'enabled'   => true,
205 205
             'style'     => 'expanded', // 'expanded' or 'compressed',
206 206
             'import'    => ['sass', 'scss', 'node_modules'],
207 207
             'sourcemap' => false, // works in debug mode only
208 208
             //'variables' => ['var' => 'value']
209 209
         ],
210
-        'minify' => [      // Minify CSS and JS
210
+        'minify' => [// Minify CSS and JS
211 211
             'enabled' => true,
212 212
         ],
213
-        'fingerprint' => [ // Add fingerprint
213
+        'fingerprint' => [// Add fingerprint
214 214
             'enabled' => true,
215 215
         ],
216 216
         'target' => 'assets', // target directory of remote and resized assets
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
             'optimize' => [
219 219
                 'enabled' => false, // enables image optimization (JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp)
220 220
             ],
221
-            'quality'    => 85,     // quality of optimized JPEG and PNG, and resized JPEG
221
+            'quality'    => 85, // quality of optimized JPEG and PNG, and resized JPEG
222 222
             'responsive' => [
223 223
                 'enabled' => false, // creates responsive images with `html` filter
224 224
                 'width'   => [
225
-                    'steps' => 5,     // number of steps between each responsives images
226
-                    'min'   => 320,   // minimum width
227
-                    'max'   => 1280,  // maximum width
225
+                    'steps' => 5, // number of steps between each responsives images
226
+                    'min'   => 320, // minimum width
227
+                    'max'   => 1280, // maximum width
228 228
                 ],
229 229
                 'sizes' => [
230 230
                     'default' => '100vw', // default sizes
Please login to merge, or discard this patch.