Passed
Push — feat/markdown-highlighter ( 98434c...38353a )
by Arnaud
03:09
created
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/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/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
          * Overrides configuration with environment variables.
63 63
          */
64 64
         $data = $this->getData();
65
-        $applyEnv = function ($array) use ($data) {
65
+        $applyEnv = function($array) use ($data) {
66 66
             $iterator = new \RecursiveIteratorIterator(
67 67
                 new \RecursiveArrayIterator($array),
68 68
                 \RecursiveIteratorIterator::SELF_FIRST
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
             throw new RuntimeException(\sprintf('The default language "%s" is not listed in "languages" key configuration.', $this->getLanguageDefault()));
445 445
         }
446 446
 
447
-        $languages = array_filter($languages, function ($language) {
447
+        $languages = array_filter($languages, function($language) {
448 448
             return !(isset($language['enabled']) && $language['enabled'] === false);
449 449
         });
450 450
 
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
@@ -141,8 +141,8 @@
 block discarded – undo
141 141
             case PageType::TERM:
142 142
                 $layouts = [
143 143
                     // "taxonomy/$term.$format.$ext", // ie: taxonomy/velo.html.twig
144
-                    "_default/term.$format.$ext",     // ie: _default/term.html.twig
145
-                    "_default/list.$format.$ext",     // ie: _default/list.html.twig
144
+                    "_default/term.$format.$ext", // ie: _default/term.html.twig
145
+                    "_default/list.$format.$ext", // ie: _default/list.html.twig
146 146
                 ];
147 147
                 if ($page->hasVariable('term')) {
148 148
                     $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
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             $page = clone $this->builder->getPages()->get('index');
32 32
         }
33 33
         // collects all pages
34
-        $subPages = $this->builder->getPages()->filter(function (Page $page) {
34
+        $subPages = $this->builder->getPages()->filter(function(Page $page) {
35 35
             return $page->getType() == TYPE::PAGE
36 36
                 && $page->isVirtual() === false // excludes virtual pages
37 37
                 && $page->getVariable('exclude') !== true;
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
         }
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/Builder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
         $this->options = array_merge([
133 133
             'drafts'  => false, // build drafts or not
134 134
             'dry-run' => false, // if dry-run is true, generated files are not saved
135
-            'page'    => '',    // specific page to build
135
+            'page'    => '', // specific page to build
136 136
         ], $options);
137 137
 
138 138
         // process each step
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
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     public function process(): void
57 57
     {
58 58
         /** @var Page $page */
59
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
59
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
60 60
             return !empty($page->getVariable('rendered'));
61 61
         });
62 62
         $max = count($filteredPages);
Please login to merge, or discard this patch.
config/default.php 1 patch
Spacing   +11 added lines, -11 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,17 +155,17 @@  discard block
 block discarded – undo
155 155
         'format' => 'yaml',
156 156
     ],
157 157
     'body' => [
158
-        'format' => 'md',         // page body format (only Markdown is supported)
158
+        'format' => 'md', // page body format (only Markdown is supported)
159 159
         'toc'    => ['h2', 'h3'], // headers used to build the table of contents
160 160
         'images' => [
161 161
             'lazy' => [
162
-                'enabled' => true,  // enables lazy loading (`true` by default)
162
+                'enabled' => true, // enables lazy loading (`true` by default)
163 163
             ],
164 164
             'caption' => [
165 165
                 'enabled' => false, // adds <figcaption> to images with a title (`false` by default)
166 166
             ],
167 167
             'remote' => [
168
-                'enabled' => true,  // enables remote image handling (`true` by default)
168
+                'enabled' => true, // enables remote image handling (`true` by default)
169 169
             ],
170 170
             'resize' => [
171 171
                 'enabled' => false, // enables image resizing by using the `width` extra attribute (`false` by default)
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             ],
179 179
         ],
180 180
         'notes' => [
181
-            'enabled' => false,  // enables Notes blocks (`false` by default)
181
+            'enabled' => false, // enables Notes blocks (`false` by default)
182 182
         ],
183 183
     ],
184 184
     // data files
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
     ],
207 207
     'assets' => [
208 208
         'dir'     => 'assets',
209
-        'compile' => [     // Compile Saas
209
+        'compile' => [// Compile Saas
210 210
             'enabled'   => true,
211 211
             'style'     => 'expanded', // 'expanded' or 'compressed',
212 212
             'import'    => ['sass', 'scss', 'node_modules'],
213 213
             'sourcemap' => false, // works in debug mode only
214 214
             //'variables' => ['var' => 'value']
215 215
         ],
216
-        'minify' => [      // Minify CSS and JS
216
+        'minify' => [// Minify CSS and JS
217 217
             'enabled' => true,
218 218
         ],
219
-        'fingerprint' => [ // Add fingerprint
219
+        'fingerprint' => [// Add fingerprint
220 220
             'enabled' => true,
221 221
         ],
222 222
         'target' => 'assets', // target directory of remote and resized assets
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             'optimize' => [
225 225
                 'enabled' => false, // enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp (`false` by default)
226 226
             ],
227
-            'quality'    => 75,     // Image quality after optimization or resize (`75` by default)
227
+            'quality'    => 75, // Image quality after optimization or resize (`75` by default)
228 228
             'responsive' => [
229 229
                 'enabled' => false, // creates responsive images with `html` filter (`false` by default)
230 230
                 'widths'  => [480, 640, 768, 1024, 1366, 1600, 1920],
Please login to merge, or discard this patch.