Lint
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
philipp lang 2022-02-15 18:38:44 +01:00
parent e6d9d0d941
commit 74d2dccadc
1 changed files with 6 additions and 11 deletions

View File

@ -2,6 +2,7 @@
namespace Aweos\Resizer\Classes; namespace Aweos\Resizer\Classes;
use Aweos\Resizer\Compressors\Compressor;
use Aweos\Resizer\Compressors\CompressorNotFoundException; use Aweos\Resizer\Compressors\CompressorNotFoundException;
use Aweos\Resizer\Compressors\Factory as CompressorFactory; use Aweos\Resizer\Compressors\Factory as CompressorFactory;
use Aweos\Resizer\Exceptions\ResizerException; use Aweos\Resizer\Exceptions\ResizerException;
@ -14,19 +15,12 @@ use Storage;
class TagGenerator { class TagGenerator {
public array $breakpoints; private Compressor $compressor;
private $compressor; public MediaPath $path;
public $path; private array $defaultOptions = [
private $defaultOptions = [
'lazy' => false, 'lazy' => false,
]; ];
public function __construct()
{
$this->breakpoints = Setting::get('breakpoints');
ksort($this->breakpoints);
}
public function generate(MediaPath $path, ?string $ratio = 'original', $sizes = null, array $options = []): string public function generate(MediaPath $path, ?string $ratio = 'original', $sizes = null, array $options = []): string
{ {
$options = array_merge($this->defaultOptions, $options); $options = array_merge($this->defaultOptions, $options);
@ -110,7 +104,8 @@ class TagGenerator {
: null; : null;
} }
private function htmlAttributes($attr) { private function htmlAttributes($attr): string
{
return $attr->map(function($value, $key) { return $attr->map(function($value, $key) {
return "{$key}=\"{$value}\""; return "{$key}=\"{$value}\"";
})->implode(' '); })->implode(' ');