Passed
Push — dependabot/composer/squizlabs/... ( 75ac83 )
by
unknown
04:10
created
config/default.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
     'title'        => 'Site title',
17 17
     //'baseline'     => 'Site baseline',
18 18
     'baseurl'      => 'http://localhost:8000/',
19
-    'canonicalurl' => false,   // if true 'url()' function preprends URL wirh 'baseurl'
19
+    'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl'
20 20
     'description'  => 'Site description',
21
-    'taxonomies'   => [        // default taxonomies
21
+    'taxonomies'   => [// default taxonomies
22 22
         'tags'       => 'tag', // can be disabled with 'disabled' value
23 23
         'categories' => 'category',
24 24
     ],
25 25
     'pagination' => [
26
-        'max'  => 5,      // number of pages on each paginated pages
26
+        'max'  => 5, // number of pages on each paginated pages
27 27
         'path' => 'page', // path to paginated pages. ie: '/blog/page/2/'
28 28
     ],
29 29
     'date' => [
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
         'format' => 'yaml', // front matter format `yaml`, `ini`, `toml` or `json` (`yaml` by default)
182 182
     ],
183 183
     'body' => [
184
-        'format'    => 'md',         // page body format (only Markdown is supported)
184
+        'format'    => 'md', // page body format (only Markdown is supported)
185 185
         'toc'       => ['h2', 'h3'], // headers used to build the table of contents
186 186
         'highlight' => [
187
-            'enabled' => false,  // enables code syntax highlighting (`false` by default)
187
+            'enabled' => false, // enables code syntax highlighting (`false` by default)
188 188
         ],
189 189
         'images' => [
190 190
             'lazy' => [
191
-                'enabled' => true,  // adds `loading="lazy"` attribute (`true` by default)
191
+                'enabled' => true, // adds `loading="lazy"` attribute (`true` by default)
192 192
             ],
193 193
             'resize' => [
194 194
                 'enabled' => false, // enables image resizing by using the `width` extra attribute (`false` by default)
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
                 'enabled' => false, // puts the image in a <figure> element and adds a <figcaption> containing the title (`false` by default)
204 204
             ],
205 205
             'remote' => [
206
-                'enabled'  => true,  // turns remote images to Asset to handling them (`true` by default)
206
+                'enabled'  => true, // turns remote images to Asset to handling them (`true` by default)
207 207
                 'fallback' => [
208 208
                     'enabled' => false, // enables a fallback if image is not found (`false` by default)
209
-                    'path'    => '',     // path to the fallback image, stored in assets dir (`` by default)
209
+                    'path'    => '', // path to the fallback image, stored in assets dir (`` by default)
210 210
                 ],
211 211
             ],
212 212
             'class' => '', // put default class to each image (`` by default)
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         ],
219 219
         'excerpt' => [
220 220
             'separator' => 'excerpt|break', // string to use as separator (`excerpt|break` by default)
221
-            'capture'   => 'before',        // part to capture, `before` or `after` the separator (`before` by default)
221
+            'capture'   => 'before', // part to capture, `before` or `after` the separator (`before` by default)
222 222
         ],
223 223
     ],
224 224
     // data files
@@ -254,17 +254,17 @@  discard block
 block discarded – undo
254 254
     ],
255 255
     'assets' => [
256 256
         'dir'     => 'assets',
257
-        'compile' => [ // Compile Saas
257
+        'compile' => [// Compile Saas
258 258
             'enabled'   => true,
259 259
             'style'     => 'expanded', // 'expanded' or 'compressed',
260 260
             'import'    => ['sass', 'scss', 'node_modules'],
261 261
             'sourcemap' => false, // works in debug mode only
262 262
             //'variables' => ['var' => 'value']
263 263
         ],
264
-        'minify' => [ // Minify CSS and JS
264
+        'minify' => [// Minify CSS and JS
265 265
             'enabled' => true,
266 266
         ],
267
-        'fingerprint' => [ // Add fingerprint
267
+        'fingerprint' => [// Add fingerprint
268 268
             'enabled' => true,
269 269
         ],
270 270
         'target' => 'assets', // target directory of remote and resized assets
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
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             /** @var \Cecil\Collection\Page\Page $page */
43 43
             $page->setType(Type::HOMEPAGE);
44 44
             // collects all pages
45
-            $subPages = $this->builder->getPages()->filter(function (Page $page) use ($language) {
45
+            $subPages = $this->builder->getPages()->filter(function(Page $page) use ($language) {
46 46
                 return $page->getType() == TYPE::PAGE
47 47
                     && $page->isVirtual() === false
48 48
                     && $page->getVariable('exclude') !== true
Please login to merge, or discard this patch.
src/Step/Pages/Render.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         /** @var Collection $pages */
67 67
         $pages = $this->builder->getPages()
68 68
             // published only
69
-            ->filter(function (Page $page) {
69
+            ->filter(function(Page $page) {
70 70
                 return (bool) $page->getVariable('published');
71 71
             })
72 72
             // enrichs some variables
73
-            ->map(function (Page $page) {
73
+            ->map(function(Page $page) {
74 74
                 $formats = $this->getOutputFormats($page);
75 75
                 // output formats
76 76
                 $page->setVariable('output', $formats);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 // renders with Twig
126 126
                 try {
127 127
                     $deprecations = [];
128
-                    set_error_handler(function ($type, $msg) use (&$deprecations) {
128
+                    set_error_handler(function($type, $msg) use (&$deprecations) {
129 129
                         if (E_USER_DEPRECATED === $type) {
130 130
                             $deprecations[] = $msg;
131 131
                         }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
     protected function getTranslations(Page $refPage): \Cecil\Collection\Page\Collection
275 275
     {
276 276
         /** @var Page $page */
277
-        $pages = $this->builder->getPages()->filter(function (Page $page) use ($refPage) {
277
+        $pages = $this->builder->getPages()->filter(function(Page $page) use ($refPage) {
278 278
             return $page->getId() !== $refPage->getId()
279 279
                 && $page->getVariable('langref') == $refPage->getVariable('langref')
280 280
                 && $page->getType() == $refPage->getType()
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 // add generator meta tag
296 296
                 if (!preg_match('/<meta name="generator".*/i', $output)) {
297 297
                     $meta = \sprintf('<meta name="generator" content="Cecil %s" />', Builder::getVersion());
298
-                    $output = preg_replace_callback('/([[:blank:]]*)(<\/head>)/i', function ($matches) use ($meta) {
298
+                    $output = preg_replace_callback('/([[:blank:]]*)(<\/head>)/i', function($matches) use ($meta) {
299 299
                         return str_repeat($matches[1] ?: ' ', 2).$meta."\n".$matches[1].$matches[2];
300 300
                     }, $output);
301 301
                 }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             //'/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
314 314
             // https://regex101.com/r/ycWMe4/1
315 315
             '/href="(\/|)([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
316
-            function ($matches) use ($page) {
316
+            function($matches) use ($page) {
317 317
                 // section spage
318 318
                 $hrefPattern = 'href="../%s/%s"';
319 319
                 // root page
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
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     protected function collectTermsFromPages(): void
97 97
     {
98 98
         /** @var \Cecil\Collection\Page\Collection $pages */
99
-        $pages = $this->builder->getPages()->filter(function (Page $page) {
99
+        $pages = $this->builder->getPages()->filter(function(Page $page) {
100 100
             return $page->getVariable('published');
101 101
         })->sortByDate();
102 102
         foreach ($pages as $page) {
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
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     public function process(): void
58 58
     {
59 59
         /** @var Page $page */
60
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
60
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
61 61
             return !empty($page->getRendered());
62 62
         });
63 63
         $total = count($filteredPages);
Please login to merge, or discard this patch.
src/Renderer/Extension/Core.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
214 214
     {
215
-        $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
215
+        $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) {
216 216
             // is a dedicated getter exists?
217 217
             $method = 'get'.ucfirst($variable);
218 218
             if (method_exists($page, $method) && $page->$method() == $value) {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      */
247 247
     public function sortByWeight(\Traversable $collection): array
248 248
     {
249
-        $callback = function ($a, $b) {
249
+        $callback = function($a, $b) {
250 250
             if (!isset($a['weight'])) {
251 251
                 $a['weight'] = 0;
252 252
             }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function sortByDate(\Traversable $collection, string $variable = 'date', bool $descTitle = false): array
274 274
     {
275
-        $callback = function ($a, $b) use ($variable, $descTitle) {
275
+        $callback = function($a, $b) use ($variable, $descTitle) {
276 276
             if ($a[$variable] == $b[$variable]) {
277 277
                 // if dates are equal and "descTitle" is true
278 278
                 if ($descTitle && (isset($a['title']) && isset($b['title']))) {
Please login to merge, or discard this patch.
src/Collection/Page/Collection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function showable(): self
27 27
     {
28
-        return $this->filter(function (Page $page) {
28
+        return $this->filter(function(Page $page) {
29 29
             if ($page->getVariable('published') === true
30 30
                 && $page->isVirtual() === false
31 31
                 && $page->getVariable('redirect') === null
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $options['descTitle'] = $options['descTitle'] ?? false;
60 60
         $options['reverse'] = $options['reverse'] ?? false;
61 61
 
62
-        $pages = $this->usort(function ($a, $b) use ($options) {
62
+        $pages = $this->usort(function($a, $b) use ($options) {
63 63
             if ($a[$options['variable']] == $b[$options['variable']]) {
64 64
                 // if dates are equal and "descTitle" is true
65 65
                 if ($options['descTitle'] && (isset($a['title']) && isset($b['title']))) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $options['reverse'] = false;
89 89
         }
90 90
 
91
-        return $this->usort(function ($a, $b) use ($options) {
91
+        return $this->usort(function($a, $b) use ($options) {
92 92
             return ($options['reverse'] ? -1 : 1) * strnatcmp($a['title'], $b['title']);
93 93
         });
94 94
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $options['reverse'] = false;
104 104
         }
105 105
 
106
-        return $this->usort(function ($a, $b) use ($options) {
106
+        return $this->usort(function($a, $b) use ($options) {
107 107
             if ($a['weight'] == $b['weight']) {
108 108
                 return 0;
109 109
             }
Please login to merge, or discard this patch.