diff --git a/classes/TagGenerator.php b/classes/TagGenerator.php index 21ef909..ea9dfdb 100644 --- a/classes/TagGenerator.php +++ b/classes/TagGenerator.php @@ -2,6 +2,7 @@ namespace Aweos\Resizer\Classes; +use Aweos\Resizer\Compressors\Compressor; use Aweos\Resizer\Compressors\CompressorNotFoundException; use Aweos\Resizer\Compressors\Factory as CompressorFactory; use Aweos\Resizer\Exceptions\ResizerException; @@ -14,19 +15,12 @@ use Storage; class TagGenerator { - public array $breakpoints; - private $compressor; - public $path; - private $defaultOptions = [ + private Compressor $compressor; + public MediaPath $path; + private array $defaultOptions = [ '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 { $options = array_merge($this->defaultOptions, $options); @@ -110,7 +104,8 @@ class TagGenerator { : null; } - private function htmlAttributes($attr) { + private function htmlAttributes($attr): string + { return $attr->map(function($value, $key) { return "{$key}=\"{$value}\""; })->implode(' ');