|
17 | 17 | use chillerlan\QRCode\Data\QRMatrix; |
18 | 18 | use chillerlan\Settings\SettingsContainerInterface; |
19 | 19 | use GdImage; |
20 | | -use function extension_loaded, imagecolorallocate, imagecolortransparent, |
21 | | - imagecreatetruecolor, imagefilledellipse, imagefilledrectangle, |
22 | | - imagescale, imagetypes, intdiv, intval, max, min, ob_end_clean, ob_get_contents, ob_start, |
23 | | - sprintf; |
| 20 | +use function extension_loaded, imagecolorallocate, imagecolortransparent, imagecreatetruecolor, |
| 21 | + imagefilledellipse, imagefilledrectangle, imagescale, imagetypes, intdiv, intval, is_iterable, |
| 22 | + max, min, ob_end_clean, ob_get_contents, ob_start, sprintf; |
24 | 23 | use const IMG_AVIF, IMG_BMP, IMG_GIF, IMG_JPG, IMG_PNG, IMG_WEBP; |
25 | 24 |
|
26 | 25 | /** |
@@ -57,7 +56,12 @@ abstract class QRGdImage extends QROutputAbstract{ |
57 | 56 | * @throws \chillerlan\QRCode\Output\QRCodeOutputException |
58 | 57 | * @noinspection PhpMissingParentConstructorInspection |
59 | 58 | */ |
60 | | - public function __construct(SettingsContainerInterface|QROptions $options, QRMatrix $matrix){ |
| 59 | + public function __construct(SettingsContainerInterface|QROptions|iterable $options, QRMatrix $matrix){ |
| 60 | + |
| 61 | + if(is_iterable($options)){ |
| 62 | + $options = new QROptions($options); |
| 63 | + } |
| 64 | + |
61 | 65 | $this->options = $options; |
62 | 66 | $this->matrix = $matrix; |
63 | 67 |
|
|
0 commit comments