Skip to content

Commit

Permalink
Ignore PHPStan errors on different Endroid versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Oct 4, 2023
1 parent 3e14033 commit 51888c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/QrCode/QrCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,21 @@ private function __construct(string $data, string $fileFormat)
// Endroid 4.x
$this->qrCode = BaseQrCode::create($data)
->setEncoding(new Encoding('UTF-8'))
/** @phpstan-ignore-next-line as it throws error if Endroid 5 is installed */
->setErrorCorrectionLevel(new ErrorCorrectionLevel\ErrorCorrectionLevelMedium())
->setSize(self::PX_QR_CODE)
->setMargin(0)
/** @phpstan-ignore-next-line as it throws error if Endroid 5 is installed */
->setRoundBlockSizeMode(new RoundBlockSizeMode\RoundBlockSizeModeEnlarge());
} else {
// Endroid 5.x
$this->qrCode = BaseQrCode::create($data)
->setEncoding(new Encoding('UTF-8'))
/** @phpstan-ignore-next-line as it throws error if Endroid 4 is installed */
->setErrorCorrectionLevel(ErrorCorrectionLevel::Medium)
->setSize(self::PX_QR_CODE)
->setMargin(0)
/** @phpstan-ignore-next-line as it throws error if Endroid 4 is installed */
->setRoundBlockSizeMode(RoundBlockSizeMode::Enlarge);
}

Expand Down

0 comments on commit 51888c0

Please sign in to comment.