Lint
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
This commit is contained in:
parent
e6d9d0d941
commit
74d2dccadc
|
@ -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(' ');
|
||||||
|
|
Loading…
Reference in New Issue