Passed
Push — v1 ( fc3fe5...5688db )
by Andrew
10:30 queued 05:53
created
src/models/OptimizedImage.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      */
368 368
     public function getPlaceholderImage(): string
369 369
     {
370
-        return (string)$this->placeholderImage();
370
+        return (string) $this->placeholderImage();
371 371
     }
372 372
 
373 373
     /**
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     public function getPlaceholderBox(string $color = null): string
406 406
     {
407
-        return (string)$this->placeholderBox($color);
407
+        return (string) $this->placeholderBox($color);
408 408
     }
409 409
 
410 410
     /**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
      */
446 446
     public function getPlaceholderSilhouette(): string
447 447
     {
448
-        return (string)$this->placeholderSilhouette();
448
+        return (string) $this->placeholderSilhouette();
449 449
     }
450 450
 
451 451
     /**
@@ -557,10 +557,10 @@  discard block
 block discarded – undo
557 557
         foreach ($array as $key => $value) {
558 558
             if ($dpr) {
559 559
                 $descriptor = '1x';
560
-                if (!empty($array[(int)$key / 2])) {
560
+                if (!empty($array[(int) $key / 2])) {
561 561
                     $descriptor = '2x';
562 562
                 }
563
-                if (!empty($array[(int)$key / 3])) {
563
+                if (!empty($array[(int) $key / 3])) {
564 564
                     $descriptor = '3x';
565 565
                 }
566 566
             } else {
Please login to merge, or discard this patch.
src/listeners/GetCraftQLSchema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,16 +39,16 @@
 block discarded – undo
39 39
 
40 40
         // Primary getter functions
41 41
         $fieldObject->addStringField('src')
42
-            ->arguments(function (\markhuot\CraftQL\Builders\Field $field) {
42
+            ->arguments(function(\markhuot\CraftQL\Builders\Field $field) {
43 43
                 $field->addIntArgument('width');
44 44
             })
45
-            ->resolve(function ($root, $args) {
45
+            ->resolve(function($root, $args) {
46 46
                 return $root->src(@$args['width'] ?: 0);
47 47
             });
48 48
         $fieldObject->addField('srcUrls')
49 49
             ->lists()
50 50
             ->type($srcObject)
51
-            ->resolve(function ($root, $args) {
51
+            ->resolve(function($root, $args) {
52 52
                 $result = [];
53 53
                 foreach ($root->optimizedImageUrls as $width => $url) {
54 54
                     $result[] = ['width' => $width, 'url' => $url];
Please login to merge, or discard this patch.
src/services/Placeholder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         Craft::beginProfile('generatePlaceholderImage', __METHOD__);
84 84
         $result = '';
85 85
         $width = self::PLACEHOLDER_WIDTH;
86
-        $height = (int)($width / $aspectRatio);
86
+        $height = (int) ($width / $aspectRatio);
87 87
         $placeholderPath = $this->createImageFromPath($tempPath, $width, $height, self::PLACEHOLDER_QUALITY, $position);
88 88
         if (!empty($placeholderPath)) {
89 89
             $result = base64_encode(file_get_contents($placeholderPath));
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     {
176 176
         Craft::beginProfile('createTempPlaceholderImage', __METHOD__);
177 177
         $width = self::TEMP_PLACEHOLDER_WIDTH;
178
-        $height = (int)($width / $aspectRatio);
178
+        $height = (int) ($width / $aspectRatio);
179 179
         $tempPath = $this->createImageFromAsset($asset, $width, $height, self::TEMP_PLACEHOLDER_QUALITY, $position);
180 180
         Craft::endProfile('createTempPlaceholderImage', __METHOD__);
181 181
 
Please login to merge, or discard this patch.
src/helpers/Manifest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $cache = Craft::$app->getCache();
404 404
         $file = $cache->getOrSet(
405 405
             self::CACHE_KEY.$path,
406
-            function () use ($path, $callback) {
406
+            function() use ($path, $callback) {
407 407
                 $result = null;
408 408
                 $contents = @file_get_contents($path);
409 409
                 if ($contents) {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
     protected static function combinePaths(string ...$paths): string
434 434
     {
435 435
         $last_key = \count($paths) - 1;
436
-        array_walk($paths, function (&$val, $key) use ($last_key) {
436
+        array_walk($paths, function(&$val, $key) use ($last_key) {
437 437
             switch ($key) {
438 438
                 case 0:
439 439
                     $val = rtrim($val, '/ ');
Please login to merge, or discard this patch.
src/variables/ManifestVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         self::$config['server']['publicPath'] = $baseAssetsUrl;
52 52
         $useDevServer = getenv('NYS_PLUGIN_DEVSERVER');
53 53
         if ($useDevServer !== false) {
54
-            self::$config['useDevServer'] = (bool)$useDevServer;
54
+            self::$config['useDevServer'] = (bool) $useDevServer;
55 55
         }
56 56
     }
57 57
 
Please login to merge, or discard this patch.
src/services/OptimizedImages.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -385,11 +385,11 @@
 block discarded – undo
385 385
         }
386 386
         $width = $variant['width'] * $retinaSize;
387 387
         $transform->width = $width;
388
-        $transform->height = (int)($width / $aspectRatio);
388
+        $transform->height = (int) ($width / $aspectRatio);
389 389
         // Image quality
390 390
         $quality = $variant['quality'] ?? null;
391 391
         if ($settings->lowerQualityRetinaImageVariants && $retinaSize != '1') {
392
-            $quality = (int)($quality * (1.5 / (int)$retinaSize));
392
+            $quality = (int) ($quality * (1.5 / (int) $retinaSize));
393 393
         }
394 394
         $transform->quality = $quality;
395 395
         // Interlaced (progressive JPEGs or interlaced PNGs)
Please login to merge, or discard this patch.
src/imagetransforms/ThumborImageTransform.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function getTransformUrl(Asset $asset, $transform, array $params = [])
41 41
     {
42
-        return (string)$this->getUrlBuilderForTransform($asset, $transform, $params);
42
+        return (string) $this->getUrlBuilderForTransform($asset, $transform, $params);
43 43
     }
44 44
 
45 45
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $builder = $this->getUrlBuilderForTransform($asset, $transform, $params)
58 58
             ->addFilter('format', 'webp');
59 59
 
60
-        return (string)$builder;
60
+        return (string) $builder;
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
src/imagetransforms/ImageTransform.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
     {
144 144
         $path = $this->decomposeUrl($pathOrUrl);
145 145
         $path_parts = pathinfo($path['path']);
146
-        $new_path = $path_parts['filename'] . '.' . $path_parts['extension'] . $extension;
146
+        $new_path = $path_parts['filename'].'.'.$path_parts['extension'].$extension;
147 147
         if (!empty($path_parts['dirname']) && $path_parts['dirname'] !== '.') {
148
-            $new_path = $path_parts['dirname'] . DIRECTORY_SEPARATOR . $new_path;
148
+            $new_path = $path_parts['dirname'].DIRECTORY_SEPARATOR.$new_path;
149 149
             $new_path = preg_replace('/([^:])(\/{2,})/', '$1/', $new_path);
150 150
         }
151
-        $output = $path['prefix'] . $new_path . $path['suffix'];
151
+        $output = $path['prefix'].$new_path.$path['suffix'];
152 152
 
153 153
         return $output;
154 154
     }
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 
170 170
         if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) {
171 171
             $url_parts = parse_url($pathOrUrl);
172
-            $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host'];
172
+            $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host'];
173 173
             $result['path'] = $url_parts['path'];
174 174
             $result['suffix'] = '';
175
-            $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query'];
176
-            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment'];
175
+            $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query'];
176
+            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment'];
177 177
         } else {
178 178
             $result['prefix'] = '';
179 179
             $result['path'] = $pathOrUrl;
Please login to merge, or discard this patch.
src/ImageOptimize.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         Event::on(
230 230
             CraftVariable::class,
231 231
             CraftVariable::EVENT_INIT,
232
-            function (Event $event) {
232
+            function(Event $event) {
233 233
                 /** @var CraftVariable $variable */
234 234
                 $variable = $event->sender;
235 235
                 $variable->set('imageOptimize', ImageOptimizeVariable::class);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         Event::on(
241 241
             Fields::class,
242 242
             Fields::EVENT_REGISTER_FIELD_TYPES,
243
-            function (RegisterComponentTypesEvent $event) {
243
+            function(RegisterComponentTypesEvent $event) {
244 244
                 Craft::debug(
245 245
                     'Fields::EVENT_REGISTER_FIELD_TYPES',
246 246
                     __METHOD__
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         Event::on(
276 276
             Assets::class,
277 277
             Assets::EVENT_GET_ASSET_URL,
278
-            function (GetAssetUrlEvent $event) {
278
+            function(GetAssetUrlEvent $event) {
279 279
                 Craft::debug(
280 280
                     'Assets::EVENT_GET_ASSET_URL',
281 281
                     __METHOD__
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         Event::on(
292 292
             Assets::class,
293 293
             Assets::EVENT_GET_ASSET_THUMB_URL,
294
-            function (GetAssetThumbUrlEvent $event) {
294
+            function(GetAssetThumbUrlEvent $event) {
295 295
                 Craft::debug(
296 296
                     'Assets::EVENT_GET_ASSET_THUMB_URL',
297 297
                     __METHOD__
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         Event::on(
308 308
             AssetTransforms::class,
309 309
             AssetTransforms::EVENT_GENERATE_TRANSFORM,
310
-            function (GenerateTransformEvent $event) {
310
+            function(GenerateTransformEvent $event) {
311 311
                 Craft::debug(
312 312
                     'AssetTransforms::EVENT_GENERATE_TRANSFORM',
313 313
                     __METHOD__
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         Event::on(
324 324
             AssetTransforms::class,
325 325
             AssetTransforms::EVENT_AFTER_DELETE_TRANSFORMS,
326
-            function (AssetTransformImageEvent $event) {
326
+            function(AssetTransformImageEvent $event) {
327 327
                 Craft::debug(
328 328
                     'AssetTransforms::EVENT_AFTER_DELETE_TRANSFORMS',
329 329
                     __METHOD__
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         Event::on(
340 340
             Assets::class,
341 341
             Assets::EVENT_BEFORE_REPLACE_ASSET,
342
-            function (ReplaceAssetEvent $event) {
342
+            function(ReplaceAssetEvent $event) {
343 343
                 Craft::debug(
344 344
                     'Assets::EVENT_BEFORE_REPLACE_ASSET',
345 345
                     __METHOD__
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         Event::on(
362 362
             Assets::class,
363 363
             Assets::EVENT_AFTER_REPLACE_ASSET,
364
-            function (ReplaceAssetEvent $event) {
364
+            function(ReplaceAssetEvent $event) {
365 365
                 Craft::debug(
366 366
                     'Assets::EVENT_AFTER_REPLACE_ASSET',
367 367
                     __METHOD__
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         Event::on(
385 385
             Assets::class,
386 386
             Elements::EVENT_BEFORE_SAVE_ELEMENT,
387
-            function (ElementEvent $event) {
387
+            function(ElementEvent $event) {
388 388
                 Craft::debug(
389 389
                     'Elements::EVENT_BEFORE_SAVE_ELEMENT',
390 390
                     __METHOD__
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
         Event::on(
409 409
             Asset::class,
410 410
             Elements::EVENT_BEFORE_DELETE_ELEMENT,
411
-            function (ElementEvent $event) {
411
+            function(ElementEvent $event) {
412 412
                 Craft::debug(
413 413
                     'Elements::EVENT_BEFORE_DELETE_ELEMENT',
414 414
                     __METHOD__
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         Event::on(
437 437
             Fields::class,
438 438
             Fields::EVENT_AFTER_SAVE_FIELD,
439
-            function (FieldEvent $event) {
439
+            function(FieldEvent $event) {
440 440
                 Craft::debug(
441 441
                     'Fields::EVENT_AFTER_SAVE_FIELD',
442 442
                     __METHOD__
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
         Event::on(
454 454
             Plugins::class,
455 455
             Plugins::EVENT_AFTER_SAVE_PLUGIN_SETTINGS,
456
-            function (PluginEvent $event) {
456
+            function(PluginEvent $event) {
457 457
                 if ($event->plugin === $this) {
458 458
                     Craft::debug(
459 459
                         'Plugins::EVENT_AFTER_SAVE_PLUGIN_SETTINGS',
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         Event::on(
473 473
             Volumes::class,
474 474
             Volumes::EVENT_AFTER_SAVE_VOLUME,
475
-            function (VolumeEvent $event) {
475
+            function(VolumeEvent $event) {
476 476
                 Craft::debug(
477 477
                     'Volumes::EVENT_AFTER_SAVE_VOLUME',
478 478
                     __METHOD__
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         Event::on(
494 494
             Plugins::class,
495 495
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
496
-            function (PluginEvent $event) {
496
+            function(PluginEvent $event) {
497 497
                 if ($event->plugin === $this) {
498 498
                     $request = Craft::$app->getRequest();
499 499
                     if ($request->isCpRequest) {
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
         Event::on(
528 528
             UrlManager::class,
529 529
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
530
-            function (RegisterUrlRulesEvent $event) {
530
+            function(RegisterUrlRulesEvent $event) {
531 531
                 Craft::debug(
532 532
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
533 533
                     __METHOD__
Please login to merge, or discard this patch.