Passed
Push — toc ( a7d83e )
by Arnaud
03:57
created
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
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function sortByDate(): self
50 50
     {
51
-        return $this->usort(function ($a, $b) {
51
+        return $this->usort(function($a, $b) {
52 52
             if ($a['date'] == $b['date']) {
53 53
                 return 0;
54 54
             }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function sortByTitle(): self
64 64
     {
65
-        return $this->usort(function ($a, $b) {
65
+        return $this->usort(function($a, $b) {
66 66
             return strnatcmp($a['title'], $b['title']);
67 67
         });
68 68
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function sortByWeight(): self
74 74
     {
75
-        return $this->usort(function ($a, $b) {
75
+        return $this->usort(function($a, $b) {
76 76
             if ($a['weight'] == $b['weight']) {
77 77
                 return 0;
78 78
             }
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
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      */
212 212
     public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
213 213
     {
214
-        $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
214
+        $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) {
215 215
             // is a dedicated getter exists?
216 216
             $method = 'get'.ucfirst($variable);
217 217
             if (method_exists($page, $method) && $page->$method() == $value) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function sortByWeight(\Traversable $collection): array
245 245
     {
246
-        $callback = function ($a, $b) {
246
+        $callback = function($a, $b) {
247 247
             if (!isset($a['weight'])) {
248 248
                 $a['weight'] = 0;
249 249
             }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      */
270 270
     public function sortByDate(\Traversable $collection, string $variable = 'date'): array
271 271
     {
272
-        $callback = function ($a, $b) use ($variable) {
272
+        $callback = function($a, $b) use ($variable) {
273 273
             if ($a[$variable] == $b[$variable]) {
274 274
                 return 0;
275 275
             }
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
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         // collects published pages
66 66
         /** @var Page $page */
67
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) {
67
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) {
68 68
             return !empty($page->getVariable('published'));
69 69
         });
70 70
         $max = count($filteredPages);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 // renders with Twig
120 120
                 try {
121 121
                     $deprecations = [];
122
-                    set_error_handler(function ($type, $msg) use (&$deprecations) {
122
+                    set_error_handler(function($type, $msg) use (&$deprecations) {
123 123
                         if (E_USER_DEPRECATED === $type) {
124 124
                             $deprecations[] = $msg;
125 125
                         }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     protected function getTranslations(Page $refPage): \Cecil\Collection\Page\Collection
265 265
     {
266 266
         /** @var Page $page */
267
-        $filteredPages = $this->builder->getPages()->filter(function (Page $page) use ($refPage) {
267
+        $filteredPages = $this->builder->getPages()->filter(function(Page $page) use ($refPage) {
268 268
             return $page->getId() !== $refPage->getId()
269 269
                 && $page->getVariable('langref') == $refPage->getVariable('langref')
270 270
                 && $page->getType() == $refPage->getType()
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                 // add generator meta tag
286 286
                 if (!preg_match('/<meta name="generator".*/i', $output)) {
287 287
                     $meta = \sprintf('<meta name="generator" content="Cecil %s" />', Builder::getVersion());
288
-                    $output = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function ($matches) use ($meta) {
288
+                    $output = preg_replace_callback('/([[:blank:]]+)(<\/head>)/i', function($matches) use ($meta) {
289 289
                         return str_repeat($matches[1], 2).$meta."\n".$matches[1].$matches[2];
290 290
                     }, $output);
291 291
                 }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             //'/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
304 304
             // https://regex101.com/r/ycWMe4/1
305 305
             '/href="(\/|)([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is',
306
-            function ($matches) use ($page) {
306
+            function($matches) use ($page) {
307 307
                 // section spage
308 308
                 $hrefPattern = 'href="../%s/%s"';
309 309
                 // root page
Please login to merge, or discard this patch.
src/Renderer/Twig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,10 +100,10 @@
 block discarded – undo
100 100
             $this->builder->getLogger()->debug('Intl extension is loaded');
101 101
         }
102 102
         // filters fallback
103
-        $this->twig->registerUndefinedFilterCallback(function ($name) {
103
+        $this->twig->registerUndefinedFilterCallback(function($name) {
104 104
             switch ($name) {
105 105
                 case 'localizeddate':
106
-                    return new \Twig\TwigFilter($name, function (\DateTime $value = null) {
106
+                    return new \Twig\TwigFilter($name, function(\DateTime $value = null) {
107 107
                         return date((string) $this->builder->getConfig()->get('date.format'), $value->getTimestamp());
108 108
                     });
109 109
             }
Please login to merge, or discard this patch.
src/Assets/Asset.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -71,25 +71,25 @@  discard block
 block discarded – undo
71 71
         $this->builder = $builder;
72 72
         $this->config = $builder->getConfig();
73 73
         $paths = is_array($paths) ? $paths : [$paths];
74
-        array_walk($paths, function ($path) {
74
+        array_walk($paths, function($path) {
75 75
             if (empty($path)) {
76 76
                 throw new RuntimeException('The path parameter of "asset() can\'t be empty."');
77 77
             }
78 78
         });
79 79
         $this->data = [
80
-            'file'           => '',    // absolute file path
81
-            'filename'       => '',    // filename
82
-            'path_source'    => '',    // public path to the file, before transformations
83
-            'path'           => '',    // public path to the file, after transformations
80
+            'file'           => '', // absolute file path
81
+            'filename'       => '', // filename
82
+            'path_source'    => '', // public path to the file, before transformations
83
+            'path'           => '', // public path to the file, after transformations
84 84
             'missing'        => false, // if file not found, but missing ollowed 'missing' is true
85
-            'ext'            => '',    // file extension
86
-            'type'           => '',    // file type (e.g.: image, audio, video, etc.)
87
-            'subtype'        => '',    // file media type (e.g.: image/png, audio/mp3, etc.)
88
-            'size'           => 0,     // file size (in bytes)
89
-            'content_source' => '',    // file content, before transformations
90
-            'content'        => '',    // file content, after transformations
91
-            'width'          => 0,     // width (in pixels) in case of an image
92
-            'height'         => 0,     // height (in pixels) in case of an image
85
+            'ext'            => '', // file extension
86
+            'type'           => '', // file type (e.g.: image, audio, video, etc.)
87
+            'subtype'        => '', // file media type (e.g.: image/png, audio/mp3, etc.)
88
+            'size'           => 0, // file size (in bytes)
89
+            'content_source' => '', // file content, before transformations
90
+            'content'        => '', // file content, after transformations
91
+            'width'          => 0, // width (in pixels) in case of an image
92
+            'height'         => 0, // height (in pixels) in case of an image
93 93
         ];
94 94
 
95 95
         // handles options
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 
435 435
             try {
436 436
                 $img = ImageManager::make($assetResized->data['content_source']);
437
-                $img->resize($width, null, function (\Intervention\Image\Constraint $constraint) {
437
+                $img->resize($width, null, function(\Intervention\Image\Constraint $constraint) {
438 438
                     $constraint->aspectRatio();
439 439
                     $constraint->upsize();
440 440
                 });
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
@@ -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,7 +203,7 @@  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
             ],
208 208
         ],
209 209
     ],
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
     ],
241 241
     'assets' => [
242 242
         'dir'     => 'assets',
243
-        'compile' => [     // Compile Saas
243
+        'compile' => [// Compile Saas
244 244
             'enabled'   => true,
245 245
             'style'     => 'expanded', // 'expanded' or 'compressed',
246 246
             'import'    => ['sass', 'scss', 'node_modules'],
247 247
             'sourcemap' => false, // works in debug mode only
248 248
             //'variables' => ['var' => 'value']
249 249
         ],
250
-        'minify' => [      // Minify CSS and JS
250
+        'minify' => [// Minify CSS and JS
251 251
             'enabled' => true,
252 252
         ],
253
-        'fingerprint' => [ // Add fingerprint
253
+        'fingerprint' => [// Add fingerprint
254 254
             'enabled' => true,
255 255
         ],
256 256
         'target' => 'assets', // target directory of remote and resized assets
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
             'optimize' => [
259 259
                 'enabled' => false, // enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp (`false` by default)
260 260
             ],
261
-            'quality'    => 75,     // Image quality after optimization or resize (`75` by default)
261
+            'quality'    => 75, // Image quality after optimization or resize (`75` by default)
262 262
             'responsive' => [
263 263
                 'enabled' => false, // creates responsive images with `html` filter (`false` by default)
264 264
                 'widths'  => [480, 640, 768, 1024, 1366, 1600, 1920],
Please login to merge, or discard this patch.