Passed
Push — master ( 6df799...6c65e7 )
by Arnaud
05:39
created
config/default.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     'metatags' => [
66 66
         'robots' => 'index,follow', // SEO robots default directive
67 67
     ],
68
-    'pages' => [ // Markdown content management
68
+    'pages' => [// Markdown content management
69 69
         'dir' => 'pages', // pages files directory
70 70
         'ext' => ['md', 'markdown', 'mdown', 'mkdn', 'mkd', 'text', 'txt'], // supported files formats, by extension
71 71
         'exclude' => ['vendor', 'node_modules'], // directories, paths and files name to exclude (accepts globs, strings and regexes)
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
                 'caption' => false, // puts the image in a <figure> element and adds a <figcaption> containing the title
100 100
                 'placeholder' => '', // fill <img> background before loading (`color` or `lqip`)
101 101
                 'class' => '', // puts default CSS class(es) to each image
102
-                'remote' => [ // turns remote images into Assets to process them (disable with `false`)
102
+                'remote' => [// turns remote images into Assets to process them (disable with `false`)
103 103
                     'fallback' => '', // path to the fallback image, stored in assets directory (empty by default)
104 104
                 ],
105 105
             ],
106 106
             'links' => [
107
-                'embed' => [ // turns links in embedded content if possible
107
+                'embed' => [// turns links in embedded content if possible
108 108
                     'enabled' => false,
109 109
                     'video' => ['mp4', 'webm'], // supported video file types, by extension
110 110
                     'audio' => ['mp3', 'ogg', 'wav'], // supported audio file types, by extension
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
         //    <position> => 'Cecil\Generator\<class>',
126 126
         //],
127 127
     ],
128
-    'data' => [ // data files
128
+    'data' => [// data files
129 129
         'dir' => 'data', // data files directory
130 130
         'ext' => ['yaml', 'yml', 'json', 'xml', 'csv'], // loaded files by extension
131 131
         'load' => true, // enables `site.data` collection
132 132
     ],
133
-    'assets' => [ // assets: CSS, JS, images, etc.
133
+    'assets' => [// assets: CSS, JS, images, etc.
134 134
         'dir' => 'assets', // assets files directory
135 135
         'target' => '', // where processed assets are saved (in output directory)
136 136
         'fingerprint' => true, // enables fingerprinting
137
-        'compile' => [ // Sass files compilation
137
+        'compile' => [// Sass files compilation
138 138
             'style' => 'expanded', // compilation style (`expanded` or `compressed`)
139 139
             'import' => ['sass', 'scss', 'node_modules'], // list of imported directories
140 140
             'sourcemap' => false, // enables sourcemap in debug mode
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             'optimize' => false, // enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp, avifenc
146 146
             'quality' => 75, // image quality after optimization or resize
147 147
             'formats' => [], // creates and adds formats images as `source` (e.g.: ['webp', 'avif'])
148
-            'responsive' => [ // options of generated responsive images
148
+            'responsive' => [// options of generated responsive images
149 149
                 'widths' => [480, 640, 768, 1024, 1366, 1600, 1920], // `srcset` widths
150 150
                 'sizes' => ['default' => '100vw'] // default `sizes` attribute
151 151
             ],
@@ -159,26 +159,26 @@  discard block
 block discarded – undo
159 159
             //]
160 160
         ],
161 161
     ],
162
-    'static' => [ // static files
162
+    'static' => [// static files
163 163
         'dir' => 'static', // static files directory
164 164
         'target' => '', // subdirectory where files are copied
165 165
         'exclude' => ['sass', 'scss', '*.scss', 'package*.json', 'node_modules'], // excluded files by extension or pattern
166 166
         'load' => false, // enables `site.static` collection
167 167
     ],
168
-    'layouts' => [ // layouts and templates
168
+    'layouts' => [// layouts and templates
169 169
         'dir' => 'layouts', // Twig templates directory
170
-        'images' => [ // how to handle images in templates
170
+        'images' => [// how to handle images in templates
171 171
             'formats' => [], // creates and adds formats images as `source` (e.g.: ['webp', 'avif'])
172 172
             'responsive' => false, // enables responsive images
173 173
             ],
174
-        'translations' => [ // i18n
174
+        'translations' => [// i18n
175 175
             'dir' => 'translations', // translations files directory
176 176
             'formats' => ['yaml', 'mo'], // translations supported formats
177 177
         ],
178
-        'extensions' => [ // list of Twig extensions class
178
+        'extensions' => [// list of Twig extensions class
179 179
             //'<name>' => 'Cecil\Renderer\Extension\<class>',
180 180
         ],
181
-        'components' => [ // components
181
+        'components' => [// components
182 182
             'dir' => 'components', // components directory
183 183
             'ext' => 'twig', // components files extension
184 184
         ],
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         //    '<section>' => '<layout>',
187 187
         //]
188 188
     ],
189
-    'output' => [ // output formats and post process
189
+    'output' => [// output formats and post process
190 190
         'dir' => '_site', // output directory
191 191
         //'formats' => [ // https://cecil.app/documentation/configuration/#formats
192 192
         //    [
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         //        'exclude' => ['variable1', 'variable2'],
198 198
         //    ],
199 199
         //],
200
-        'pagetypeformats' => [ // formats applied by page type
200
+        'pagetypeformats' => [// formats applied by page type
201 201
             'page' => ['html'],
202 202
             'homepage' => ['html', 'atom'],
203 203
             'section' => ['html', 'atom'],
@@ -208,10 +208,10 @@  discard block
 block discarded – undo
208 208
         //    '<name>' => 'Cecil\Renderer\PostProcessor\<class>',
209 209
         //],
210 210
     ],
211
-    'cache' => [ // cache management
211
+    'cache' => [// cache management
212 212
         'enabled' => true, // disable with `false`
213 213
         'dir' => '.cache', // cache files root directory
214
-        'assets' => [ // assets cache
214
+        'assets' => [// assets cache
215 215
             'ttl' => null, // assets cache TTL (no expiration by default)
216 216
             'remote' => [
217 217
                 'ttl' => 604800, // remote assets cache TTL (7 days by default)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         'templates' => true, // disable Twig templates cache with `false`
221 221
         'translations' => true, // disable translations dictionary cache with `false`
222 222
     ],
223
-    'optimize' => [ // files optimization
223
+    'optimize' => [// files optimization
224 224
         'enabled' => false, // enables files optimization
225 225
         'html' => [
226 226
             'enabled' => true, // enables HTML files optimization
Please login to merge, or discard this patch.
src/Assets/Asset.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      *
63 63
      * @throws RuntimeException
64 64
      */
65
-    public function __construct(Builder $builder, string|array $paths, array|null $options = null)
65
+    public function __construct(Builder $builder, string | array $paths, array | null $options = null)
66 66
     {
67 67
         $this->builder = $builder;
68 68
         $this->config = $builder->getConfig();
@@ -83,21 +83,21 @@  discard block
 block discarded – undo
83 83
             }
84 84
         });
85 85
         $this->data = [
86
-            'file'     => '',    // absolute file path
87
-            'files'    => [],    // array of absolute files path
86
+            'file'     => '', // absolute file path
87
+            'files'    => [], // array of absolute files path
88 88
             'missing'  => false, // if file not found but missing allowed: 'missing' is true
89
-            '_path'    => '',    // original path
90
-            'path'     => '',    // public path
91
-            'url'      => null,  // URL if it's a remote file
92
-            'ext'      => '',    // file extension
93
-            'type'     => '',    // file type (e.g.: image, audio, video, etc.)
94
-            'subtype'  => '',    // file media type (e.g.: image/png, audio/mp3, etc.)
95
-            'size'     => 0,     // file size (in bytes)
96
-            'width'    => 0,     // image width (in pixels)
97
-            'height'   => 0,     // image height (in pixels)
98
-            'exif'     => [],    // image exif data
99
-            'content'  => '',    // file content
100
-            'hash'     => '',    // file content hash (md5)
89
+            '_path'    => '', // original path
90
+            'path'     => '', // public path
91
+            'url'      => null, // URL if it's a remote file
92
+            'ext'      => '', // file extension
93
+            'type'     => '', // file type (e.g.: image, audio, video, etc.)
94
+            'subtype'  => '', // file media type (e.g.: image/png, audio/mp3, etc.)
95
+            'size'     => 0, // file size (in bytes)
96
+            'width'    => 0, // image width (in pixels)
97
+            'height'   => 0, // image height (in pixels)
98
+            'exif'     => [], // image exif data
99
+            'content'  => '', // file content
100
+            'hash'     => '', // file content hash (md5)
101 101
         ];
102 102
 
103 103
         // handles options
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
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      *   reverse    => false|true
64 64
      * ]
65 65
      */
66
-    public function sortBy(string|array|null $options): self
66
+    public function sortBy(string | array | null $options): self
67 67
     {
68 68
         $sortBy = \is_string($options) ? $options : $options['variable'] ?? 'date';
69 69
         $sortMethod = \sprintf('sortBy%s', ucfirst(str_replace('updated', 'date', $sortBy)));
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * Sorts pages by date (or 'updated'): the most recent first.
79 79
      */
80
-    public function sortByDate(string|array|null $options = null): self
80
+    public function sortByDate(string | array | null $options = null): self
81 81
     {
82 82
         $opt = [];
83 83
         // backward compatibility (i.e. $options = 'updated')
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * Sorts pages by title (natural sort).
113 113
      */
114
-    public function sortByTitle(string|array|null $options = null): self
114
+    public function sortByTitle(string | array | null $options = null): self
115 115
     {
116 116
         $opt = [];
117 117
         // options
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     /**
126 126
      * Sorts by weight (the heaviest first).
127 127
      */
128
-    public function sortByWeight(string|array|null $options = null): self
128
+    public function sortByWeight(string | array | null $options = null): self
129 129
     {
130 130
         $opt = [];
131 131
         // options
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
@@ -304,7 +304,7 @@
 block discarded – undo
304 304
     /**
305 305
      * Set configuration.
306 306
      */
307
-    public function setConfig(array|Config $config): self
307
+    public function setConfig(array | Config $config): self
308 308
     {
309 309
         if (\is_array($config)) {
310 310
             $config = new Config($config);
Please login to merge, or discard this patch.