Passed
Push — dependabot/composer/phpstan/ph... ( fca076 )
by
unknown
03:59
created
src/Assets/Url.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@
 block discarded – undo
61 61
 
62 62
         // handles options
63 63
         $canonical = null; // if true, add prefix URL with baseurl
64
-        $format = null;    // set output format
65
-        $language = null;  // force language
64
+        $format = null; // set output format
65
+        $language = null; // force language
66 66
         extract(is_array($options) ? $options : [], EXTR_IF_EXISTS);
67 67
 
68 68
         // canonical URL?
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
-        return $this->usort(function ($a, $b) use ($options) {
62
+        return $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']))) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $options['reverse'] = false;
84 84
         }
85 85
 
86
-        return $this->usort(function ($a, $b) use ($options) {
86
+        return $this->usort(function($a, $b) use ($options) {
87 87
             return ($options['reverse'] ? -1 : 1) * strnatcmp($a['title'], $b['title']);
88 88
         });
89 89
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $options['reverse'] = false;
99 99
         }
100 100
 
101
-        return $this->usort(function ($a, $b) use ($options) {
101
+        return $this->usort(function($a, $b) use ($options) {
102 102
             if ($a['weight'] == $b['weight']) {
103 103
                 return 0;
104 104
             }
Please login to merge, or discard this patch.
src/Step/Pages/Generate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         Util::autoload($this->builder, 'generators');
51 51
 
52 52
         $generators = (array) $this->builder->getConfig()->get('generators');
53
-        array_walk($generators, function ($generator, $priority) use ($generatorManager) {
53
+        array_walk($generators, function($generator, $priority) use ($generatorManager) {
54 54
             if (!class_exists($generator)) {
55 55
                 $message = \sprintf('Unable to load generator "%s".', $generator);
56 56
                 $this->builder->getLogger()->error($message);
Please login to merge, or discard this patch.
src/Util.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public static function joinPath(string ...$path): string
42 42
     {
43
-        $path = array_filter($path, function ($path) {
43
+        $path = array_filter($path, function($path) {
44 44
             return !empty($path) && !is_null($path);
45 45
         });
46
-        array_walk($path, function (&$value, $key) {
46
+        array_walk($path, function(&$value, $key) {
47 47
             $value = str_replace('\\', '/', $value);
48 48
             $value = rtrim($value, '/');
49 49
             $value = $key == 0 ? $value : ltrim($value, '/');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public static function joinFile(string ...$path): string
59 59
     {
60
-        array_walk($path, function (&$value, $key) use (&$path) {
60
+        array_walk($path, function(&$value, $key) use (&$path) {
61 61
             $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value);
62 62
             $value = rtrim($value, DIRECTORY_SEPARATOR);
63 63
             $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public static function autoload(Builder $builder, string $dir): void
87 87
     {
88
-        spl_autoload_register(function ($className) use ($builder, $dir) {
88
+        spl_autoload_register(function($className) use ($builder, $dir) {
89 89
             $classFile = Util::joinFile($builder->getConfig()->getSourceDir(), $dir, "$className.php");
90 90
             if (file_exists($classFile)) {
91 91
                 require $classFile;
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
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
215 215
     {
216
-        $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
216
+        $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) {
217 217
             // is a dedicated getter exists?
218 218
             $method = 'get'.ucfirst($variable);
219 219
             if (method_exists($page, $method) && $page->$method() == $value) {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     public function sortByWeight(\Traversable $collection, bool $reverse = false): array
249 249
     {
250
-        $callback = function ($a, $b) use ($reverse) {
250
+        $callback = function($a, $b) use ($reverse) {
251 251
             if (!isset($a['weight'])) {
252 252
                 $a['weight'] = 0;
253 253
             }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
      */
274 274
     public function sortByDate(\Traversable $collection, string $variable = 'date', bool $reverse = false, bool $descTitle = false): array
275 275
     {
276
-        $callback = function ($a, $b) use ($variable, $reverse, $descTitle) {
276
+        $callback = function($a, $b) use ($variable, $reverse, $descTitle) {
277 277
             if ($a[$variable] == $b[$variable]) {
278 278
                 // if dates are equal and "descTitle" is true
279 279
                 if ($descTitle && (isset($a['title']) && isset($b['title']))) {
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,12 +203,12 @@  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
         'excerpt' => [
210 210
             'separator' => 'excerpt|break', // string to use as separator (`excerpt|break` by default)
211
-            'capture'   => 'before',        // part to capture, `before` or `after` the separator (`before` by default)
211
+            'capture'   => 'before', // part to capture, `before` or `after` the separator (`before` by default)
212 212
         ],
213 213
     ],
214 214
     // data files
@@ -244,17 +244,17 @@  discard block
 block discarded – undo
244 244
     ],
245 245
     'assets' => [
246 246
         'dir'     => 'assets',
247
-        'compile' => [ // Compile Saas
247
+        'compile' => [// Compile Saas
248 248
             'enabled'   => true,
249 249
             'style'     => 'expanded', // 'expanded' or 'compressed',
250 250
             'import'    => ['sass', 'scss', 'node_modules'],
251 251
             'sourcemap' => false, // works in debug mode only
252 252
             //'variables' => ['var' => 'value']
253 253
         ],
254
-        'minify' => [ // Minify CSS and JS
254
+        'minify' => [// Minify CSS and JS
255 255
             'enabled' => true,
256 256
         ],
257
-        'fingerprint' => [ // Add fingerprint
257
+        'fingerprint' => [// Add fingerprint
258 258
             'enabled' => true,
259 259
         ],
260 260
         'target' => 'assets', // target directory of remote and resized assets
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
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->builder = $builder;
66 66
         $this->config = $builder->getConfig();
67 67
         $paths = is_array($paths) ? $paths : [$paths];
68
-        array_walk($paths, function ($path) {
68
+        array_walk($paths, function($path) {
69 69
             if (empty($path)) {
70 70
                 throw new RuntimeException('The path to an asset can\'t be empty.');
71 71
             }
@@ -74,20 +74,20 @@  discard block
 block discarded – undo
74 74
             }
75 75
         });
76 76
         $this->data = [
77
-            'file'           => '',    // absolute file path
78
-            'files'          => [],    // bundle: files path
79
-            'filename'       => '',    // filename
80
-            'path_source'    => '',    // public path to the file, before transformations
81
-            'path'           => '',    // public path to the file, after transformations
77
+            'file'           => '', // absolute file path
78
+            'files'          => [], // bundle: files path
79
+            'filename'       => '', // filename
80
+            'path_source'    => '', // public path to the file, before transformations
81
+            'path'           => '', // public path to the file, after transformations
82 82
             'missing'        => false, // if file not found, but missing ollowed 'missing' is true
83
-            'ext'            => '',    // file extension
84
-            'type'           => '',    // file type (e.g.: image, audio, video, etc.)
85
-            'subtype'        => '',    // file media type (e.g.: image/png, audio/mp3, etc.)
86
-            'size'           => 0,     // file size (in bytes)
87
-            'content_source' => '',    // file content, before transformations
88
-            'content'        => '',    // file content, after transformations
89
-            'width'          => 0,     // width (in pixels) in case of an image
90
-            'height'         => 0,     // height (in pixels) in case of an image
83
+            'ext'            => '', // file extension
84
+            'type'           => '', // file type (e.g.: image, audio, video, etc.)
85
+            'subtype'        => '', // file media type (e.g.: image/png, audio/mp3, etc.)
86
+            'size'           => 0, // file size (in bytes)
87
+            'content_source' => '', // file content, before transformations
88
+            'content'        => '', // file content, after transformations
89
+            'width'          => 0, // width (in pixels) in case of an image
90
+            'height'         => 0, // height (in pixels) in case of an image
91 91
         ];
92 92
 
93 93
         // handles options
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 
430 430
             try {
431 431
                 $img = ImageManager::make($assetResized->data['content_source']);
432
-                $img->resize($width, null, function (\Intervention\Image\Constraint $constraint) {
432
+                $img->resize($width, null, function(\Intervention\Image\Constraint $constraint) {
433 433
                     $constraint->aspectRatio();
434 434
                     $constraint->upsize();
435 435
                 });
Please login to merge, or discard this patch.