Passed
Push — dependabot/composer/phpstan/ph... ( ee06df )
by
unknown
03:39
created
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   +10 added lines, -10 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
Please login to merge, or discard this patch.
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.