Exception
3 years ago
Factory
3 years ago
Writer
3 years ago
ErrorCorrectionLevel.php
3 years ago
LabelAlignment.php
3 years ago
QrCode.php
3 years ago
QrCodeInterface.php
3 years ago
WriterRegistry.php
3 years ago
WriterRegistryInterface.php
3 years ago
ErrorCorrectionLevel.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | /* |
| 5 | * (c) Jeroen van den Enden <info@endroid.nl> |
| 6 | * |
| 7 | * This source file is subject to the MIT license that is bundled |
| 8 | * with this source code in the file LICENSE. |
| 9 | */ |
| 10 | namespace WP2FA_Vendor\Endroid\QrCode; |
| 11 | |
| 12 | use WP2FA_Vendor\BaconQrCode\Common\ErrorCorrectionLevel as BaconErrorCorrectionLevel; |
| 13 | use WP2FA_Vendor\MyCLabs\Enum\Enum; |
| 14 | /** |
| 15 | * @method static ErrorCorrectionLevel LOW() |
| 16 | * @method static ErrorCorrectionLevel MEDIUM() |
| 17 | * @method static ErrorCorrectionLevel QUARTILE() |
| 18 | * @method static ErrorCorrectionLevel HIGH() |
| 19 | * |
| 20 | * @extends Enum<string> |
| 21 | * @psalm-immutable |
| 22 | */ |
| 23 | class ErrorCorrectionLevel extends Enum |
| 24 | { |
| 25 | const LOW = 'low'; |
| 26 | const MEDIUM = 'medium'; |
| 27 | const QUARTILE = 'quartile'; |
| 28 | const HIGH = 'high'; |
| 29 | /** |
| 30 | * @psalm-suppress ImpureMethodCall |
| 31 | */ |
| 32 | public function toBaconErrorCorrectionLevel() : BaconErrorCorrectionLevel |
| 33 | { |
| 34 | $name = \strtoupper(\substr($this->getValue(), 0, 1)); |
| 35 | return BaconErrorCorrectionLevel::valueOf($name); |
| 36 | } |
| 37 | } |
| 38 |