From 74d2dccadc2f9dfde3866e2a40971da223b0f5d2 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 15 Feb 2022 18:38:44 +0100 Subject: [PATCH] Lint --- classes/TagGenerator.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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(' ');