diff --git a/src/Common/CharacterSetEci.php b/src/Common/CharacterSetEci.php index 8b62b8c..6c35d1b 100644 --- a/src/Common/CharacterSetEci.php +++ b/src/Common/CharacterSetEci.php @@ -87,7 +87,7 @@ final class CharacterSetEci extends AbstractEnum /** * @param int[] $values */ - public function __construct(private readonly array $values, string ...$otherEncodingNames) + public function __construct(private array $values, string ...$otherEncodingNames) { $this->otherEncodingNames = $otherEncodingNames; } diff --git a/src/Common/EcBlock.php b/src/Common/EcBlock.php index bc9e865..6f8c606 100644 --- a/src/Common/EcBlock.php +++ b/src/Common/EcBlock.php @@ -11,7 +11,7 @@ namespace BaconQrCode\Common; */ final class EcBlock { - public function __construct(private readonly int $count, private readonly int $dataCodewords) + public function __construct(private int $count, private int $dataCodewords) { } diff --git a/src/Common/EcBlocks.php b/src/Common/EcBlocks.php index 63c52a9..3464dc6 100644 --- a/src/Common/EcBlocks.php +++ b/src/Common/EcBlocks.php @@ -19,7 +19,7 @@ final class EcBlocks */ private array $ecBlocks; - public function __construct(private readonly int $ecCodewordsPerBlock, EcBlock ...$ecBlocks) + public function __construct(private int $ecCodewordsPerBlock, EcBlock ...$ecBlocks) { $this->ecBlocks = $ecBlocks; } diff --git a/src/Common/ErrorCorrectionLevel.php b/src/Common/ErrorCorrectionLevel.php index ac84d66..449ef5f 100644 --- a/src/Common/ErrorCorrectionLevel.php +++ b/src/Common/ErrorCorrectionLevel.php @@ -21,7 +21,7 @@ final class ErrorCorrectionLevel extends AbstractEnum protected const Q = [0x03]; protected const H = [0x02]; - protected function __construct(private readonly int $bits) + protected function __construct(private int $bits) { } diff --git a/src/Common/Mode.php b/src/Common/Mode.php index f5fb153..521c910 100644 --- a/src/Common/Mode.php +++ b/src/Common/Mode.php @@ -36,8 +36,8 @@ final class Mode extends AbstractEnum * @param int[] $characterCountBitsForVersions */ protected function __construct( - private readonly array $characterCountBitsForVersions, - private readonly int $bits + private array $characterCountBitsForVersions, + private int $bits ) { } diff --git a/src/Encoder/BlockPair.php b/src/Encoder/BlockPair.php index b1dc5c4..0e6118d 100644 --- a/src/Encoder/BlockPair.php +++ b/src/Encoder/BlockPair.php @@ -17,8 +17,8 @@ final class BlockPair * @param SplFixedArray $errorCorrectionBytes Error correction bytes in the block. */ public function __construct( - private readonly SplFixedArray $dataBytes, - private readonly SplFixedArray $errorCorrectionBytes + private SplFixedArray $dataBytes, + private SplFixedArray $errorCorrectionBytes ) { } diff --git a/src/Encoder/ByteMatrix.php b/src/Encoder/ByteMatrix.php index eefcf1c..ffdada6 100644 --- a/src/Encoder/ByteMatrix.php +++ b/src/Encoder/ByteMatrix.php @@ -18,7 +18,7 @@ final class ByteMatrix */ private SplFixedArray $bytes; - public function __construct(private readonly int $width, private readonly int $height) + public function __construct(private int $width, private int $height) { $this->bytes = new SplFixedArray($height); diff --git a/src/Encoder/QrCode.php b/src/Encoder/QrCode.php index c3398f4..251aee8 100644 --- a/src/Encoder/QrCode.php +++ b/src/Encoder/QrCode.php @@ -28,9 +28,9 @@ final class QrCode private ByteMatrix $matrix; public function __construct( - private readonly Mode $mode, - private readonly ErrorCorrectionLevel $errorCorrectionLevel, - private readonly Version $version, + private Mode $mode, + private ErrorCorrectionLevel $errorCorrectionLevel, + private Version $version, int $maskPattern, ByteMatrix $matrix ) { diff --git a/src/Renderer/Color/Alpha.php b/src/Renderer/Color/Alpha.php index 067a554..cfc289f 100644 --- a/src/Renderer/Color/Alpha.php +++ b/src/Renderer/Color/Alpha.php @@ -10,7 +10,7 @@ final class Alpha implements ColorInterface /** * @param int $alpha the alpha value, 0 to 100 */ - public function __construct(private readonly int $alpha, private readonly ColorInterface $baseColor) + public function __construct(private int $alpha, private ColorInterface $baseColor) { if ($alpha < 0 || $alpha > 100) { throw new Exception\InvalidArgumentException('Alpha must be between 0 and 100'); diff --git a/src/Renderer/Color/Cmyk.php b/src/Renderer/Color/Cmyk.php index eaf34f4..a8e5ce1 100644 --- a/src/Renderer/Color/Cmyk.php +++ b/src/Renderer/Color/Cmyk.php @@ -14,10 +14,10 @@ final class Cmyk implements ColorInterface * @param int $black the black amount, 0 to 100 */ public function __construct( - private readonly int $cyan, - private readonly int $magenta, - private readonly int $yellow, - private readonly int $black + private int $cyan, + private int $magenta, + private int $yellow, + private int $black ) { if ($cyan < 0 || $cyan > 100) { throw new Exception\InvalidArgumentException('Cyan must be between 0 and 100'); diff --git a/src/Renderer/Color/Gray.php b/src/Renderer/Color/Gray.php index 760b861..4dee81b 100644 --- a/src/Renderer/Color/Gray.php +++ b/src/Renderer/Color/Gray.php @@ -10,7 +10,7 @@ final class Gray implements ColorInterface /** * @param int $gray the gray value between 0 (black) and 100 (white) */ - public function __construct(private readonly int $gray) + public function __construct(private int $gray) { if ($gray < 0 || $gray > 100) { throw new Exception\InvalidArgumentException('Gray must be between 0 and 100'); diff --git a/src/Renderer/Color/Rgb.php b/src/Renderer/Color/Rgb.php index 051c5be..3eb7cd6 100644 --- a/src/Renderer/Color/Rgb.php +++ b/src/Renderer/Color/Rgb.php @@ -12,7 +12,7 @@ final class Rgb implements ColorInterface * @param int $green the green amount of the color, 0 to 255 * @param int $blue the blue amount of the color, 0 to 255 */ - public function __construct(private readonly int $red, private readonly int $green, private readonly int $blue) + public function __construct(private int $red, private int $green, private int $blue) { if ($red < 0 || $red > 255) { throw new Exception\InvalidArgumentException('Red must be between 0 and 255'); diff --git a/src/Renderer/Eye/CompositeEye.php b/src/Renderer/Eye/CompositeEye.php index 379e5c7..2fa0622 100644 --- a/src/Renderer/Eye/CompositeEye.php +++ b/src/Renderer/Eye/CompositeEye.php @@ -10,7 +10,7 @@ use BaconQrCode\Renderer\Path\Path; */ final class CompositeEye implements EyeInterface { - public function __construct(private readonly EyeInterface $externalEye, private readonly EyeInterface $internalEye) + public function __construct(private EyeInterface $externalEye, private EyeInterface $internalEye) { } diff --git a/src/Renderer/Eye/ModuleEye.php b/src/Renderer/Eye/ModuleEye.php index a8a3489..ee1540a 100644 --- a/src/Renderer/Eye/ModuleEye.php +++ b/src/Renderer/Eye/ModuleEye.php @@ -12,7 +12,7 @@ use BaconQrCode\Renderer\Path\Path; */ final class ModuleEye implements EyeInterface { - public function __construct(private readonly ModuleInterface $module) + public function __construct(private ModuleInterface $module) { } diff --git a/src/Renderer/ImageRenderer.php b/src/Renderer/ImageRenderer.php index 0d33303..0f99770 100644 --- a/src/Renderer/ImageRenderer.php +++ b/src/Renderer/ImageRenderer.php @@ -14,8 +14,8 @@ use BaconQrCode\Renderer\RendererStyle\RendererStyle; final class ImageRenderer implements RendererInterface { public function __construct( - private readonly RendererStyle $rendererStyle, - private readonly ImageBackEndInterface $imageBackEnd + private RendererStyle $rendererStyle, + private ImageBackEndInterface $imageBackEnd ) { } diff --git a/src/Renderer/Module/DotsModule.php b/src/Renderer/Module/DotsModule.php index c5d5c6f..6cf0d2c 100644 --- a/src/Renderer/Module/DotsModule.php +++ b/src/Renderer/Module/DotsModule.php @@ -16,7 +16,7 @@ final class DotsModule implements ModuleInterface public const MEDIUM = .8; public const SMALL = .6; - public function __construct(private readonly float $size) + public function __construct(private float $size) { if ($size <= 0 || $size > 1) { throw new InvalidArgumentException('Size must between 0 (exclusive) and 1 (inclusive)'); diff --git a/src/Renderer/Module/EdgeIterator/Edge.php b/src/Renderer/Module/EdgeIterator/Edge.php index 141d66c..f27a223 100644 --- a/src/Renderer/Module/EdgeIterator/Edge.php +++ b/src/Renderer/Module/EdgeIterator/Edge.php @@ -23,7 +23,7 @@ final class Edge private int $maxY = -1; - public function __construct(private readonly bool $positive) + public function __construct(private bool $positive) { } diff --git a/src/Renderer/Path/Curve.php b/src/Renderer/Path/Curve.php index 5233e49..8640568 100644 --- a/src/Renderer/Path/Curve.php +++ b/src/Renderer/Path/Curve.php @@ -6,12 +6,12 @@ namespace BaconQrCode\Renderer\Path; final class Curve implements OperationInterface { public function __construct( - private readonly float $x1, - private readonly float $y1, - private readonly float $x2, - private readonly float $y2, - private readonly float $x3, - private readonly float $y3 + private float $x1, + private float $y1, + private float $x2, + private float $y2, + private float $x3, + private float $y3 ) { } diff --git a/src/Renderer/Path/EllipticArc.php b/src/Renderer/Path/EllipticArc.php index 800a032..49a2574 100644 --- a/src/Renderer/Path/EllipticArc.php +++ b/src/Renderer/Path/EllipticArc.php @@ -15,10 +15,10 @@ final class EllipticArc implements OperationInterface float $xRadius, float $yRadius, float $xAxisAngle, - private readonly bool $largeArc, - private readonly bool $sweep, - private readonly float $x, - private readonly float $y + private bool $largeArc, + private bool $sweep, + private float $x, + private float $y ) { $this->xRadius = abs($xRadius); $this->yRadius = abs($yRadius); diff --git a/src/Renderer/Path/Line.php b/src/Renderer/Path/Line.php index dec46fd..56f1f84 100644 --- a/src/Renderer/Path/Line.php +++ b/src/Renderer/Path/Line.php @@ -5,7 +5,7 @@ namespace BaconQrCode\Renderer\Path; final class Line implements OperationInterface { - public function __construct(private readonly float $x, private readonly float $y) + public function __construct(private float $x, private float $y) { } diff --git a/src/Renderer/Path/Move.php b/src/Renderer/Path/Move.php index c3c9a56..b7475ae 100644 --- a/src/Renderer/Path/Move.php +++ b/src/Renderer/Path/Move.php @@ -5,7 +5,7 @@ namespace BaconQrCode\Renderer\Path; final class Move implements OperationInterface { - public function __construct(private readonly float $x, private readonly float $y) + public function __construct(private float $x, private float $y) { } diff --git a/src/Renderer/PlainTextRenderer.php b/src/Renderer/PlainTextRenderer.php index 219bbf3..879ea0b 100644 --- a/src/Renderer/PlainTextRenderer.php +++ b/src/Renderer/PlainTextRenderer.php @@ -28,7 +28,7 @@ final class PlainTextRenderer implements RendererInterface */ private const EMPTY_BLOCK = "\xc2\xa0"; - public function __construct(private readonly int $margin = 2) + public function __construct(private int $margin = 2) { } diff --git a/src/Renderer/RendererStyle/EyeFill.php b/src/Renderer/RendererStyle/EyeFill.php index 9953b55..05c591d 100644 --- a/src/Renderer/RendererStyle/EyeFill.php +++ b/src/Renderer/RendererStyle/EyeFill.php @@ -11,8 +11,8 @@ final class EyeFill private static ?EyeFill $inherit = null; public function __construct( - private readonly ?ColorInterface $externalColor, - private readonly ?ColorInterface $internalColor + private ?ColorInterface $externalColor, + private ?ColorInterface $internalColor ) { } diff --git a/src/Renderer/RendererStyle/Fill.php b/src/Renderer/RendererStyle/Fill.php index 19de25d..7835c51 100644 --- a/src/Renderer/RendererStyle/Fill.php +++ b/src/Renderer/RendererStyle/Fill.php @@ -12,12 +12,12 @@ final class Fill private static ?Fill $default = null; private function __construct( - private readonly ColorInterface $backgroundColor, - private readonly ?ColorInterface $foregroundColor, - private readonly ?Gradient $foregroundGradient, - private readonly EyeFill $topLeftEyeFill, - private readonly EyeFill $topRightEyeFill, - private readonly EyeFill $bottomLeftEyeFill + private ColorInterface $backgroundColor, + private ?ColorInterface $foregroundColor, + private ?Gradient $foregroundGradient, + private EyeFill $topLeftEyeFill, + private EyeFill $topRightEyeFill, + private EyeFill $bottomLeftEyeFill ) { } diff --git a/src/Renderer/RendererStyle/Gradient.php b/src/Renderer/RendererStyle/Gradient.php index eea4031..477aa09 100644 --- a/src/Renderer/RendererStyle/Gradient.php +++ b/src/Renderer/RendererStyle/Gradient.php @@ -8,9 +8,9 @@ use BaconQrCode\Renderer\Color\ColorInterface; final class Gradient { public function __construct( - private readonly ColorInterface $startColor, - private readonly ColorInterface $endColor, - private readonly GradientType $type + private ColorInterface $startColor, + private ColorInterface $endColor, + private GradientType $type ) { } diff --git a/src/Writer.php b/src/Writer.php index d7f7ebb..59fa47f 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -17,7 +17,7 @@ final class Writer /** * Creates a new writer with a specific renderer. */ - public function __construct(private readonly RendererInterface $renderer) + public function __construct(private RendererInterface $renderer) { }