mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-15 16:26:23 +00:00
:octocat: mark nullable types explicitly (https://github.com/chillerlan/php-qrcode/issues/276)
This commit is contained in:
@@ -251,7 +251,7 @@ final class BitMatrix extends QRMatrix{
|
||||
/**
|
||||
* Returns information about the format it specifies, or null if it doesn't seem to match any known pattern
|
||||
*/
|
||||
private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2):?int{
|
||||
private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2):int|null{
|
||||
$bestDifference = PHP_INT_MAX;
|
||||
$bestFormatInfo = 0;
|
||||
|
||||
@@ -347,7 +347,7 @@ final class BitMatrix extends QRMatrix{
|
||||
/**
|
||||
* Decodes the version information from the given bit sequence, returns null if no valid match is found.
|
||||
*/
|
||||
private function decodeVersionInformation(int $versionBits):?Version{
|
||||
private function decodeVersionInformation(int $versionBits):Version|null{
|
||||
$bestDifference = PHP_INT_MAX;
|
||||
$bestVersion = 0;
|
||||
|
||||
@@ -414,7 +414,7 @@ final class BitMatrix extends QRMatrix{
|
||||
* @codeCoverageIgnore
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public function setQuietZone(int $quietZoneSize = null):static{
|
||||
public function setQuietZone(int|null $quietZoneSize = null):static{
|
||||
throw new QRCodeDataException('not supported');
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ final class BitMatrix extends QRMatrix{
|
||||
* @codeCoverageIgnore
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public function setLogoSpace(int $width, int $height = null, int $startX = null, int $startY = null):static{
|
||||
public function setLogoSpace(int $width, int|null $height = null, int|null $startX = null, int|null $startY = null):static{
|
||||
throw new QRCodeDataException('not supported');
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ final class Decoder{
|
||||
* @var \chillerlan\QRCode\QROptions|\chillerlan\Settings\SettingsContainerInterface
|
||||
*/
|
||||
private SettingsContainerInterface|QROptions $options;
|
||||
private ?Version $version = null;
|
||||
private ?EccLevel $eccLevel = null;
|
||||
private ?MaskPattern $maskPattern = null;
|
||||
private Version|null $version = null;
|
||||
private EccLevel|null $eccLevel = null;
|
||||
private MaskPattern|null $maskPattern = null;
|
||||
private BitBuffer $bitBuffer;
|
||||
|
||||
public function __construct(SettingsContainerInterface|QROptions $options = new QROptions){
|
||||
|
||||
@@ -41,7 +41,7 @@ final class DecoderResult{
|
||||
/**
|
||||
* DecoderResult constructor.
|
||||
*/
|
||||
public function __construct(iterable $properties = null){
|
||||
public function __construct(iterable|null $properties = null){
|
||||
|
||||
if(!empty($properties)){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user