feat: add QRCodeOptions provider

feat: add QRCodeOptions provider
This commit is contained in:
Ondrej Vlach 2024-01-16 20:29:40 +01:00
parent e89290473b
commit 928ff810e6
Signed by: ovlach
GPG Key ID: 4FF1A23B4914DE70
3 changed files with 33 additions and 0 deletions

View File

@ -28,5 +28,7 @@ services:
$available_currencies: '%app.currencies%'
App\Service\CurrencyListerInterface: '@App\Service\StaticCurrencyLister'
App\Service\QRCodeQROptionsProviderInterface: '@App\Service\QRCodeQROptionsDefaultProvider'
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones

View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\QRCode\QRCodeQROptions;
readonly class QRCodeQROptionsDefaultProvider implements QRCodeQROptionsProviderInterface {
private readonly QRCodeQROptions $qrCodeDefaultOptions;
public function __construct() {
$this->qrCodeDefaultOptions = new QRCodeQROptions(
1,
0
);
}
public function getDefault(): QRCodeQROptions {
return $this->qrCodeDefaultOptions;
}
}

View File

@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\QRCode\QRCodeQROptions;
interface QRCodeQROptionsProviderInterface {
public function getDefault(): QRCodeQROptions;
}