diff --git a/composer.json b/composer.json index e7c76586b..7dd0447df 100644 --- a/composer.json +++ b/composer.json @@ -49,17 +49,17 @@ "require": { "php": "^8.2", "ext-mbstring": "*", - "chillerlan/php-settings-container": "^3.2" + "chillerlan/php-settings-container": "^3.2.1" }, "require-dev": { - "chillerlan/php-authenticator": "^5.1", + "chillerlan/php-authenticator": "^5.2.1", "intervention/image": "^3.7", "phpbench/phpbench": "^1.2.15", "phan/phan": "^5.4", "phpunit/phpunit": "^11.2", "phpmd/phpmd": "^2.15", "setasign/fpdf": "^1.8.2", - "squizlabs/php_codesniffer": "^3.9" + "squizlabs/php_codesniffer": "^3.10" }, "suggest": { "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.", diff --git a/examples/custom_output.php b/examples/custom_output.php index 25bac3f80..69ec5737f 100644 --- a/examples/custom_output.php +++ b/examples/custom_output.php @@ -48,7 +48,7 @@ class MyCustomOutput extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ $output = ''; for($y = 0; $y < $this->moduleCount; $y++){ diff --git a/examples/imageWithLogo.php b/examples/imageWithLogo.php index 2f159c773..35b447535 100644 --- a/examples/imageWithLogo.php +++ b/examples/imageWithLogo.php @@ -30,7 +30,7 @@ class QRImageWithLogo extends QRGdImagePNG{ * @return string * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ - public function dump(string $file = null, string $logo = null):string{ + public function dump(string|null $file = null, string|null $logo = null):string{ // set returnResource to true to skip further processing for now $this->options->returnResource = true; diff --git a/examples/imageWithText.php b/examples/imageWithText.php index 0f68870c5..be71e220b 100644 --- a/examples/imageWithText.php +++ b/examples/imageWithText.php @@ -26,7 +26,7 @@ class QRImageWithText extends QRGdImagePNG{ /** * @inheritDoc */ - public function dump(string $file = null, string $text = null):string{ + public function dump(string|null $file = null, string|null $text = null):string{ // set returnResource to true to skip further processing for now $this->options->returnResource = true; diff --git a/examples/imagickConvertSVGtoPNG.php b/examples/imagickConvertSVGtoPNG.php index 11734d82a..c4351f39c 100644 --- a/examples/imagickConvertSVGtoPNG.php +++ b/examples/imagickConvertSVGtoPNG.php @@ -47,7 +47,7 @@ class SVGConvert extends QRMarkupSVG{ } /** @inheritDoc */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ $base64 = $this->options->outputBase64; // we don't want the SVG in base64 $this->options->outputBase64 = false; diff --git a/examples/imagickWithLogo.php b/examples/imagickWithLogo.php index 39ba164f5..21141a848 100644 --- a/examples/imagickWithLogo.php +++ b/examples/imagickWithLogo.php @@ -28,7 +28,7 @@ class QRImagickWithLogo extends QRImagick{ * @inheritDoc * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ // set returnResource to true to skip further processing for now $this->options->returnResource = true; diff --git a/src/Common/ECICharset.php b/src/Common/ECICharset.php index 0c98e36da..09f90c19a 100644 --- a/src/Common/ECICharset.php +++ b/src/Common/ECICharset.php @@ -118,7 +118,7 @@ final class ECICharset{ * @see \mb_convert_encoding() * @see \iconv() */ - public function getName():?string{ + public function getName():string|null{ return (self::MB_ENCODINGS[$this->charsetID] ?? null); } diff --git a/src/Common/GenericGFPoly.php b/src/Common/GenericGFPoly.php index ae361b9d0..7aeafc96a 100644 --- a/src/Common/GenericGFPoly.php +++ b/src/Common/GenericGFPoly.php @@ -35,7 +35,7 @@ final class GenericGFPoly{ * @throws \chillerlan\QRCode\QRCodeException if argument is null or empty, or if leading coefficient is 0 and this * is not a constant polynomial (that is, it is not the monomial "0") */ - public function __construct(array $coefficients, int $degree = null){ + public function __construct(array $coefficients, int|null $degree = null){ $degree ??= 0; if(empty($coefficients)){ diff --git a/src/Common/Version.php b/src/Common/Version.php index fe7240f8a..15a4d4a9b 100644 --- a/src/Common/Version.php +++ b/src/Common/Version.php @@ -257,7 +257,7 @@ final class Version{ /** * the version pattern for the given version */ - public function getVersionPattern():?int{ + public function getVersionPattern():int|null{ return (self::VERSION_PATTERN[$this->version] ?? null); } diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index bcf141cda..9bf3d0b61 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -110,12 +110,12 @@ class QRMatrix{ /** * the matrix version - always set in QRMatrix, may be null in BitMatrix */ - protected ?Version $version = null; + protected Version|null $version = null; /** * the current ECC level - always set in QRMatrix, may be null in BitMatrix */ - protected ?EccLevel $eccLevel = null; + protected EccLevel|null $eccLevel = null; /** * the mask pattern that was used in the most recent operation, set via: @@ -124,7 +124,7 @@ class QRMatrix{ * - QRMatrix::mask() * - BitMatrix::readFormatInformation() */ - protected ?MaskPattern $maskPattern = null; + protected MaskPattern|null $maskPattern = null; /** * the size (side length) of the matrix, including quiet zone (if created) @@ -175,7 +175,7 @@ class QRMatrix{ * * @return int[][]|bool[][] */ - public function getMatrix(bool $boolean = null):array{ + public function getMatrix(bool|null $boolean = null):array{ if($boolean !== true){ return $this->matrix; @@ -193,21 +193,21 @@ class QRMatrix{ /** * Returns the current version number */ - public function getVersion():?Version{ + public function getVersion():Version|null{ return $this->version; } /** * Returns the current ECC level */ - public function getEccLevel():?EccLevel{ + public function getEccLevel():EccLevel|null{ return $this->eccLevel; } /** * Returns the current mask pattern */ - public function getMaskPattern():?MaskPattern{ + public function getMaskPattern():MaskPattern|null{ return $this->maskPattern; } @@ -342,7 +342,7 @@ class QRMatrix{ * 7 # 3 * 6 5 4 */ - public function checkNeighbours(int $x, int $y, int $M_TYPE = null):int{ + public function checkNeighbours(int $x, int $y, int|null $M_TYPE = null):int{ $bits = 0; foreach($this::neighbours as $bit => [$ix, $iy]){ @@ -507,7 +507,7 @@ class QRMatrix{ * * ISO/IEC 18004:2000 Section 8.9 */ - public function setFormatInfo(MaskPattern $maskPattern = null):static{ + public function setFormatInfo(MaskPattern|null $maskPattern = null):static{ $this->maskPattern = $maskPattern; $bits = 0; // sets all format fields to false (test mode) @@ -633,7 +633,7 @@ class QRMatrix{ * * @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{ $height ??= $width; // if width and height happen to be negative or 0 (default value), just return - nothing to do diff --git a/src/Decoder/BitMatrix.php b/src/Decoder/BitMatrix.php index 1aec32ac6..2ec302a89 100644 --- a/src/Decoder/BitMatrix.php +++ b/src/Decoder/BitMatrix.php @@ -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'); } diff --git a/src/Decoder/Decoder.php b/src/Decoder/Decoder.php index 3d8dc39a7..a6d129d4c 100644 --- a/src/Decoder/Decoder.php +++ b/src/Decoder/Decoder.php @@ -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){ diff --git a/src/Decoder/DecoderResult.php b/src/Decoder/DecoderResult.php index 02b4d7931..4b64b51f6 100644 --- a/src/Decoder/DecoderResult.php +++ b/src/Decoder/DecoderResult.php @@ -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)){ diff --git a/src/Detector/AlignmentPatternFinder.php b/src/Detector/AlignmentPatternFinder.php index ca62c6f36..b4ee41fdf 100644 --- a/src/Detector/AlignmentPatternFinder.php +++ b/src/Detector/AlignmentPatternFinder.php @@ -58,7 +58,7 @@ final class AlignmentPatternFinder{ * * @return \chillerlan\QRCode\Detector\AlignmentPattern|null */ - public function find(int $startX, int $startY, int $width, int $height):?AlignmentPattern{ + public function find(int $startX, int $startY, int $width, int $height):AlignmentPattern|null{ $maxJ = ($startX + $width); $middleI = ($startY + ($height / 2)); $stateCount = []; @@ -173,7 +173,7 @@ final class AlignmentPatternFinder{ * * @return \chillerlan\QRCode\Detector\AlignmentPattern|null if we have found the same pattern twice, or null if not */ - private function handlePossibleCenter(array $stateCount, int $i, int $j):?AlignmentPattern{ + private function handlePossibleCenter(array $stateCount, int $i, int $j):AlignmentPattern|null{ $stateCountTotal = ($stateCount[0] + $stateCount[1] + $stateCount[2]); $centerJ = $this->centerFromEnd($stateCount, $j); $centerI = $this->crossCheckVertical($i, (int)$centerJ, (2 * $stateCount[1]), $stateCountTotal); @@ -222,7 +222,7 @@ final class AlignmentPatternFinder{ * * @return float|null vertical center of alignment pattern, or null if not found */ - private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{ + private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):float|null{ $maxI = $this->matrix->getSize(); $stateCount = []; $stateCount[0] = 0; diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index e43798b9f..a4a6d34c8 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -275,7 +275,7 @@ final class Detector{ int $estAlignmentX, int $estAlignmentY, float $allowanceFactor - ):?AlignmentPattern{ + ):AlignmentPattern|null{ // Look for an alignment pattern (3 modules in size) around where it should be $dimension = $this->matrix->getSize(); $allowance = (int)($allowanceFactor * $overallEstModuleSize); @@ -305,11 +305,11 @@ final class Detector{ * */ private function createTransform( - FinderPattern $nw, - FinderPattern $ne, - FinderPattern $sw, - int $size, - AlignmentPattern $ap = null + FinderPattern $nw, + FinderPattern $ne, + FinderPattern $sw, + int $size, + AlignmentPattern|null $ap = null ):PerspectiveTransform{ $dimMinusThree = ($size - 3.5); diff --git a/src/Detector/FinderPattern.php b/src/Detector/FinderPattern.php index 79e13e9c6..2c0ebd439 100644 --- a/src/Detector/FinderPattern.php +++ b/src/Detector/FinderPattern.php @@ -27,7 +27,7 @@ final class FinderPattern extends ResultPoint{ /** * */ - public function __construct(float $posX, float $posY, float $estimatedModuleSize, int $count = null){ + public function __construct(float $posX, float $posY, float $estimatedModuleSize, int|null $count = null){ parent::__construct($posX, $posY, $estimatedModuleSize); $this->count = ($count ?? 1); diff --git a/src/Detector/FinderPatternFinder.php b/src/Detector/FinderPatternFinder.php index 755d08c27..03de4a1a8 100644 --- a/src/Detector/FinderPatternFinder.php +++ b/src/Detector/FinderPatternFinder.php @@ -330,7 +330,7 @@ final class FinderPatternFinder{ * @return float|null vertical center of finder pattern, or null if not found * @noinspection DuplicatedCode */ - private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{ + private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):float|null{ $maxI = $this->matrix->getSize(); $stateCount = $this->getCrossCheckStateCount(); @@ -414,7 +414,7 @@ final class FinderPatternFinder{ * check a vertical cross-check and locate the real center of the alignment pattern. * @noinspection DuplicatedCode */ - private function crossCheckHorizontal(int $startJ, int $centerI, int $maxCount, int $originalStateCountTotal):?float{ + private function crossCheckHorizontal(int $startJ, int $centerI, int $maxCount, int $originalStateCountTotal):float|null{ $maxJ = $this->matrix->getSize(); $stateCount = $this->getCrossCheckStateCount(); diff --git a/src/Detector/PerspectiveTransform.php b/src/Detector/PerspectiveTransform.php index 4f1f6547a..ec4b2fba2 100644 --- a/src/Detector/PerspectiveTransform.php +++ b/src/Detector/PerspectiveTransform.php @@ -152,7 +152,7 @@ final class PerspectiveTransform{ /** * @return array[] [$xValues, $yValues] */ - public function transformPoints(array $xValues, array $yValues = null):array{ + public function transformPoints(array $xValues, array|null $yValues = null):array{ $max = count($xValues); if($yValues !== null){ // unused diff --git a/src/Output/QREps.php b/src/Output/QREps.php index d60f1c22c..75f10ecdb 100644 --- a/src/Output/QREps.php +++ b/src/Output/QREps.php @@ -101,7 +101,7 @@ class QREps extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ [$width, $height] = $this->getOutputDimensions(); $eps = [ diff --git a/src/Output/QRFpdf.php b/src/Output/QRFpdf.php index 35cf7e555..989724e4f 100644 --- a/src/Output/QRFpdf.php +++ b/src/Output/QRFpdf.php @@ -29,8 +29,8 @@ class QRFpdf extends QROutputAbstract{ final public const MIME_TYPE = 'application/pdf'; - protected FPDF $fpdf; - protected ?array $prevColor = null; + protected FPDF $fpdf; + protected array|null $prevColor = null; /** * QRFpdf constructor. @@ -64,7 +64,7 @@ class QRFpdf extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null, FPDF $fpdf = null):string|FPDF{ + public function dump(string|null $file = null, FPDF|null $fpdf = null):string|FPDF{ $this->fpdf = ($fpdf ?? $this->initFPDF()); if($this::moduleValueIsValid($this->options->bgColor)){ diff --git a/src/Output/QRGdImage.php b/src/Output/QRGdImage.php index e58cbae24..3125672a0 100644 --- a/src/Output/QRGdImage.php +++ b/src/Output/QRGdImage.php @@ -144,7 +144,7 @@ abstract class QRGdImage extends QROutputAbstract{ * * @throws \ErrorException */ - public function dump(string $file = null):string|GdImage{ + public function dump(string|null $file = null):string|GdImage{ set_error_handler(function(int $errno, string $errstr):bool{ throw new ErrorException($errstr, $errno); diff --git a/src/Output/QRImagick.php b/src/Output/QRImagick.php index 4ba43e4eb..387fcdbad 100644 --- a/src/Output/QRImagick.php +++ b/src/Output/QRImagick.php @@ -111,7 +111,7 @@ class QRImagick extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string|Imagick{ + public function dump(string|null $file = null):string|Imagick{ $this->setBgColor(); $this->imagick = $this->createImage(); diff --git a/src/Output/QRInterventionImage.php b/src/Output/QRInterventionImage.php index 298ff655b..c2b7a31c3 100644 --- a/src/Output/QRInterventionImage.php +++ b/src/Output/QRInterventionImage.php @@ -85,7 +85,7 @@ class QRInterventionImage extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string|ImageInterface{ + public function dump(string|null $file = null):string|ImageInterface{ [$width, $height] = $this->getOutputDimensions(); $this->image = $this->manager->create($width, $height); diff --git a/src/Output/QRMarkup.php b/src/Output/QRMarkup.php index e7cce5f88..983f22b09 100644 --- a/src/Output/QRMarkup.php +++ b/src/Output/QRMarkup.php @@ -19,7 +19,7 @@ abstract class QRMarkup extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ $saveToFile = $file !== null; $data = $this->createMarkup($saveToFile); diff --git a/src/Output/QROutputAbstract.php b/src/Output/QROutputAbstract.php index 14489b436..9d1224958 100644 --- a/src/Output/QROutputAbstract.php +++ b/src/Output/QROutputAbstract.php @@ -180,7 +180,7 @@ abstract class QROutputAbstract implements QROutputInterface{ /** * Returns a base64 data URI for the given string and mime type */ - protected function toBase64DataURI(string $data, string $mime = null):string{ + protected function toBase64DataURI(string $data, string|null $mime = null):string{ return sprintf('data:%s;base64,%s', ($mime ?? static::MIME_TYPE), base64_encode($data)); } @@ -192,7 +192,7 @@ abstract class QROutputAbstract implements QROutputInterface{ * * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ - protected function saveToFile(string $data, string $file = null):void{ + protected function saveToFile(string $data, string|null $file = null):void{ if($file === null){ return; diff --git a/src/Output/QROutputInterface.php b/src/Output/QROutputInterface.php index 8ef4d7928..b262157d0 100644 --- a/src/Output/QROutputInterface.php +++ b/src/Output/QROutputInterface.php @@ -129,6 +129,6 @@ interface QROutputInterface{ * * @see \chillerlan\QRCode\QRCode::renderMatrix() */ - public function dump(string $file = null):mixed; + public function dump(string|null $file = null):mixed; } diff --git a/src/Output/QRStringJSON.php b/src/Output/QRStringJSON.php index 3182129d4..05e580bb6 100644 --- a/src/Output/QRStringJSON.php +++ b/src/Output/QRStringJSON.php @@ -34,7 +34,7 @@ class QRStringJSON extends QROutputAbstract{ * @inheritDoc * @throws \JsonException */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ [$width, $height] = $this->getOutputDimensions(); $version = $this->matrix->getVersion(); $dimension = $version->getDimension(); diff --git a/src/Output/QRStringText.php b/src/Output/QRStringText.php index 309f123fc..594e1d841 100644 --- a/src/Output/QRStringText.php +++ b/src/Output/QRStringText.php @@ -43,7 +43,7 @@ class QRStringText extends QROutputAbstract{ /** * @inheritDoc */ - public function dump(string $file = null):string{ + public function dump(string|null $file = null):string{ $lines = []; $linestart = $this->options->textLineStart; @@ -66,7 +66,7 @@ class QRStringText extends QROutputAbstract{ * * @codeCoverageIgnore */ - public static function ansi8(string $str, int $color, bool $background = null):string{ + public static function ansi8(string $str, int $color, bool|null $background = null):string{ $color = max(0, min($color, 255)); $background = ($background === true) ? 48 : 38; diff --git a/src/QRCode.php b/src/QRCode.php index 5140cfe46..dc54558bc 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -77,7 +77,7 @@ class QRCode{ /** * Renders a QR Code for the given $data and QROptions, saves $file optionally */ - public function render(string $data = null, string $file = null):mixed{ + public function render(string|null $data = null, string|null $file = null):mixed{ if($data !== null){ /** @var \chillerlan\QRCode\Data\QRDataModeInterface $dataInterface */ @@ -97,7 +97,7 @@ class QRCode{ /** * Renders a QR Code for the given QRMatrix and QROptions, saves $file optionally */ - public function renderMatrix(QRMatrix $matrix, string $file = null):mixed{ + public function renderMatrix(QRMatrix $matrix, string|null $file = null):mixed{ return $this->initOutputInterface($matrix)->dump($file ?? $this->options->cachefile); } diff --git a/src/QROptionsTrait.php b/src/QROptionsTrait.php index 6a50b7671..49a8b05b2 100644 --- a/src/QROptionsTrait.php +++ b/src/QROptionsTrait.php @@ -125,7 +125,7 @@ trait QROptionsTrait{ * @see \chillerlan\QRCode\QRCode::render() * @see \chillerlan\QRCode\QRCode::renderMatrix() */ - protected ?string $cachefile = null; + protected string|null $cachefile = null; /** * Toggle base64 data URI or raw data output (if applicable) @@ -249,24 +249,24 @@ trait QROptionsTrait{ * * if only `QROptions::$logoSpaceWidth` is given, the logo space is assumed a square of that size */ - protected ?int $logoSpaceWidth = null; + protected int|null $logoSpaceWidth = null; /** * Height of the logo space * * if only `QROptions::$logoSpaceHeight` is given, the logo space is assumed a square of that size */ - protected ?int $logoSpaceHeight = null; + protected int|null $logoSpaceHeight = null; /** * Optional horizontal start position of the logo space (top left corner) */ - protected ?int $logoSpaceStartX = null; + protected int|null $logoSpaceStartX = null; /** * Optional vertical start position of the logo space (top left corner) */ - protected ?int $logoSpaceStartY = null; + protected int|null $logoSpaceStartY = null; /* @@ -431,7 +431,7 @@ trait QROptionsTrait{ * * @see https://developer.mozilla.org/en-US/docs/Web/XSLT */ - protected ?string $xmlStylesheet = null; + protected string|null $xmlStylesheet = null; /** @@ -517,7 +517,7 @@ trait QROptionsTrait{ /** * clamp the logo space values between 0 and maximum length (177 modules at version 40) */ - protected function clampLogoSpaceValue(?int $value):?int{ + protected function clampLogoSpaceValue(int|null $value):int|null{ if($value === null){ return null; @@ -529,28 +529,28 @@ trait QROptionsTrait{ /** * clamp/set logo space width */ - protected function set_logoSpaceWidth(?int $value):void{ + protected function set_logoSpaceWidth(int|null $value):void{ $this->logoSpaceWidth = $this->clampLogoSpaceValue($value); } /** * clamp/set logo space height */ - protected function set_logoSpaceHeight(?int $value):void{ + protected function set_logoSpaceHeight(int|null $value):void{ $this->logoSpaceHeight = $this->clampLogoSpaceValue($value); } /** * clamp/set horizontal logo space start */ - protected function set_logoSpaceStartX(?int $value):void{ + protected function set_logoSpaceStartX(int|null $value):void{ $this->logoSpaceStartX = $this->clampLogoSpaceValue($value); } /** * clamp/set vertical logo space start */ - protected function set_logoSpaceStartY(?int $value):void{ + protected function set_logoSpaceStartY(int|null $value):void{ $this->logoSpaceStartY = $this->clampLogoSpaceValue($value); } diff --git a/tests/Common/ECICharsetTest.php b/tests/Common/ECICharsetTest.php index 6046c093e..726102ae7 100644 --- a/tests/Common/ECICharsetTest.php +++ b/tests/Common/ECICharsetTest.php @@ -40,7 +40,7 @@ final class ECICharsetTest extends TestCase{ } #[DataProvider('encodingProvider')] - public function testGetName(int $id, string $name = null):void{ + public function testGetName(int $id, string|null $name = null):void{ $eciCharset = new ECICharset($id); $this::assertSame($id, $eciCharset->getID());