mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-17 17:31:07 +00:00
:octocat: allow invocation with options iterable for the public facing classes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user