:octocat: allow invocation with options iterable for the public facing classes

This commit is contained in:
smiley
2025-11-17 18:38:10 +01:00
parent 490cc43b47
commit d0462ee466
7 changed files with 35 additions and 14 deletions
+8 -1
View File
@@ -28,8 +28,15 @@ require_once __DIR__.'/../vendor/autoload.php';
class QRGdRounded extends QRGdImagePNG{
public function __construct(SettingsContainerInterface|QROptions $options, QRMatrix $matrix){
public function __construct(SettingsContainerInterface|QROptions|iterable $options, QRMatrix $matrix){
if(is_iterable($options)){
$options = new QROptions($options);
}
// enable the internal scaling for better rounding results at scale < 20
// we need to do this before calling the parent constructor as these values are used there
$options->gdImageUseUpscale = true;
$options->drawCircularModules = true;
parent::__construct($options, $matrix);