for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Riclep\Storyblok\Support\ImageTransformers;
use Illuminate\Support\Str;
class StoryblokSvg extends BaseTransformer
{
public function buildUrl(): string {
return $this->assetDomain();
}
protected function extractMetaDetails(): void
$path = $this->image->content()['filename'];
preg_match_all('/(?<width>\d+)x(?<height>\d+).+\.(?<extension>[a-z]{3,4})/mi', $path, $dimensions, PREG_SET_ORDER, 0);
$this->meta = [
'height' => null,
'width' => null,
'extension' => 'svg',
'mime' => 'image/svg+xml',
];
public function resize(int $width, int $height = null): static
$width
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function resize(/** @scrutinizer ignore-unused */ int $width, int $height = null): static
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$height
public function resize(int $width, /** @scrutinizer ignore-unused */ int $height = null): static
return $this;
public function fitIn(int $width = 0, int $height = 0, string $fill = 'transparent'): static
public function fitIn(/** @scrutinizer ignore-unused */ int $width = 0, int $height = 0, string $fill = 'transparent'): static
public function fitIn(int $width = 0, /** @scrutinizer ignore-unused */ int $height = 0, string $fill = 'transparent'): static
$fill
public function fitIn(int $width = 0, int $height = 0, /** @scrutinizer ignore-unused */ string $fill = 'transparent'): static
public function format(string $format, int $quality = null): static
$format
public function format(/** @scrutinizer ignore-unused */ string $format, int $quality = null): static
$quality
public function format(string $format, /** @scrutinizer ignore-unused */ int $quality = null): static
/**
* Sets the asset domain
*
* @param $options
* @return string
*/
protected function assetDomain($options = null): string
$options
protected function assetDomain(/** @scrutinizer ignore-unused */ $options = null): string
$resource = str_replace(config('storyblok.asset_domain'), config('storyblok.image_service_domain'), $this->image->content()['filename']);
return $resource;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.