Allow QR codes to be generated for disabled short URLs

This commit is contained in:
Alejandro Celaya
2023-12-22 13:29:22 +01:00
parent 225905fcdb
commit 06306aabd5
9 changed files with 51 additions and 17 deletions

View File

@@ -4,20 +4,22 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Options;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ENABLED_FOR_DISABLED_SHORT_URLS;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ERROR_CORRECTION;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_FORMAT;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_MARGIN;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ROUND_BLOCK_SIZE;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_SIZE;
final class QrCodeOptions
readonly final class QrCodeOptions
{
public function __construct(
public readonly int $size = DEFAULT_QR_CODE_SIZE,
public readonly int $margin = DEFAULT_QR_CODE_MARGIN,
public readonly string $format = DEFAULT_QR_CODE_FORMAT,
public readonly string $errorCorrection = DEFAULT_QR_CODE_ERROR_CORRECTION,
public readonly bool $roundBlockSize = DEFAULT_QR_CODE_ROUND_BLOCK_SIZE,
public int $size = DEFAULT_QR_CODE_SIZE,
public int $margin = DEFAULT_QR_CODE_MARGIN,
public string $format = DEFAULT_QR_CODE_FORMAT,
public string $errorCorrection = DEFAULT_QR_CODE_ERROR_CORRECTION,
public bool $roundBlockSize = DEFAULT_QR_CODE_ROUND_BLOCK_SIZE,
public bool $enabledForDisabledShortUrls = DEFAULT_QR_CODE_ENABLED_FOR_DISABLED_SHORT_URLS,
) {
}
}