| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Endroid\QrCode\Bacon; |
| 6 |
|
| 7 |
use BaconQrCode\Common\ErrorCorrectionLevel as BaconErrorCorrectionLevel; |
| 8 |
use Endroid\QrCode\ErrorCorrectionLevel; |
| 9 |
|
| 10 |
final class ErrorCorrectionLevelConverter |
| 11 |
{ |
| 12 |
public static function convertToBaconErrorCorrectionLevel(ErrorCorrectionLevel $errorCorrectionLevel): BaconErrorCorrectionLevel |
| 13 |
{ |
| 14 |
return match ($errorCorrectionLevel) { |
| 15 |
ErrorCorrectionLevel::Low => BaconErrorCorrectionLevel::valueOf('L'), |
| 16 |
ErrorCorrectionLevel::Medium => BaconErrorCorrectionLevel::valueOf('M'), |
| 17 |
ErrorCorrectionLevel::Quartile => BaconErrorCorrectionLevel::valueOf('Q'), |
| 18 |
ErrorCorrectionLevel::High => BaconErrorCorrectionLevel::valueOf('H') |
| 19 |
}; |
| 20 |
} |
| 21 |
} |