diff --git a/.phan/config.php b/.phan/config.php index 67d77ec97..93b9c0db8 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -56,6 +56,8 @@ return [ 'PhanAccessOverridesFinalConstant', 'PhanDeprecatedClass', 'PhanDeprecatedClassConstant', + 'PhanDeprecatedFunction', + 'PhanDeprecatedProperty', 'PhanNoopNew', 'PhanTypePossiblyInvalidDimOffset', ], diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 577eb68a9..5bfef038a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,14 @@ parameters: ignoreErrors: + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/BenchmarkAbstract.php + - rawMessage: 'Method chillerlan\QRCodeBenchmark\BenchmarkAbstract::dataModeProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn' identifier: missingType.generics @@ -18,24 +27,123 @@ parameters: count: 1 path: benchmark/BenchmarkAbstract.php + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/DecoderBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/DecoderBenchmark.php + - rawMessage: 'Property chillerlan\QRCodeBenchmark\DecoderBenchmark::$imageBlob (string) does not accept GdImage|string.' identifier: assign.propertyType count: 1 path: benchmark/DecoderBenchmark.php + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/MaskPatternBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/MaskPatternBenchmark.php + - rawMessage: 'Method chillerlan\QRCodeBenchmark\MaskPatternBenchmark::versionProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn' identifier: missingType.generics count: 1 path: benchmark/MaskPatternBenchmark.php + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/OutputBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/OutputBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/QRCodeBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/QRCodeBenchmark.php + - rawMessage: 'Parameter #1 $segment of method chillerlan\QRCode\QRCode::addSegment() expects chillerlan\QRCode\Data\QRDataModeInterface, object given.' identifier: argument.type count: 1 path: benchmark/QRCodeBenchmark.php + - + rawMessage: ''' + Call to deprecated method getBitBuffer() of class chillerlan\QRCode\Data\QRData: + 6.0.1 This method will be removed. In v7, use the property "QRData::$bitBuffer" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/QRDataBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: benchmark/QRDataBenchmark.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 2 + path: benchmark/QRDataBenchmark.php + - rawMessage: 'Parameter #2 $dataSegments of class chillerlan\QRCode\Data\QRData constructor expects array, array given.' identifier: argument.type @@ -72,12 +180,6 @@ parameters: count: 1 path: benchmark/parse-common.php - - - rawMessage: Possibly invalid array key type int|null. - identifier: offsetAccess.invalidOffset - count: 1 - path: benchmark/parse-common.php - - rawMessage: 'Function chillerlan\QRCodeBenchmark\parseLine() return type has no value type specified in iterable type array.' identifier: missingType.iterableValue @@ -106,6 +208,15 @@ parameters: count: 1 path: examples/custom_output.php + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 1 + path: examples/imageWithLogo.php + - rawMessage: 'Method QRGdRounded::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue @@ -160,6 +271,87 @@ parameters: count: 1 path: examples/qrcode-interactive.php + - + rawMessage: ''' + Access to deprecated property $connectPaths of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgMeltedModules.php + + - + rawMessage: ''' + Access to deprecated property $excludeFromConnect of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgMeltedModules.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: examples/svgMeltedModules.php + + - + rawMessage: ''' + Access to deprecated property $connectPaths of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgModuleGroupShape.php + + - + rawMessage: ''' + Access to deprecated property $excludeFromConnect of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgModuleGroupShape.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: examples/svgModuleGroupShape.php + + - + rawMessage: ''' + Access to deprecated property $connectPaths of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgRandomColoredDots.php + + - + rawMessage: ''' + Access to deprecated property $excludeFromConnect of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgRandomColoredDots.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: examples/svgRandomColoredDots.php + - rawMessage: 'Method RandomDotsSVGOutput::collectModules() should return array but returns array>.' identifier: return.type @@ -172,6 +364,33 @@ parameters: count: 1 path: examples/svgRandomColoredDots.php + - + rawMessage: ''' + Access to deprecated property $connectPaths of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgRoundQuietzone.php + + - + rawMessage: ''' + Access to deprecated property $excludeFromConnect of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. + ''' + identifier: property.deprecated + count: 1 + path: examples/svgRoundQuietzone.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: examples/svgRoundQuietzone.php + - rawMessage: 'Method RoundQuietzoneSVGoutput::collectModules() should return array but returns array>.' identifier: return.type @@ -184,6 +403,24 @@ parameters: count: 1 path: examples/svgRoundQuietzone.php + - + rawMessage: ''' + Call to deprecated method getPattern() of class chillerlan\QRCode\Common\MaskPattern: + 6.0.1 This method will be removed. In v7, use the property "MaskPattern::$currentPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Common/EccLevel.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Common/EccLevel.php + - rawMessage: 'Parameter #1 $data of function imagecreatefromstring expects string, string|false given.' identifier: argument.type @@ -208,6 +445,15 @@ parameters: count: 3 path: src/Common/GF256.php + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Common/MaskPattern.php + - rawMessage: 'Parameter #1 $maskPattern of class chillerlan\QRCode\Common\MaskPattern constructor expects int, int|false given.' identifier: argument.type @@ -221,10 +467,22 @@ parameters: path: src/Common/Version.php - - rawMessage: 'Parameter #1 $codepoint of function chr expects int<0, 255>, int given.' - identifier: argument.type + rawMessage: ''' + Call to deprecated method getLength() of class chillerlan\QRCode\Common\BitBuffer: + 6.0.1 This method will be removed. In v7, use the property "BitBuffer::$length" instead. + ''' + identifier: method.deprecated + count: 8 + path: src/Data/QRData.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated count: 1 - path: src/Data/Byte.php + path: src/Data/QRData.php - rawMessage: 'Parameter #1 $version of class chillerlan\QRCode\Data\ReedSolomonEncoder constructor expects chillerlan\QRCode\Common\Version, chillerlan\QRCode\Common\Version|null given.' @@ -238,6 +496,51 @@ parameters: count: 1 path: src/Data/QRMatrix.php + - + rawMessage: ''' + Call to deprecated method getBuffer() of class chillerlan\QRCode\Common\BitBuffer: + 6.0.1 This method will be removed in v7, use the property "BitBuffer::$buffer" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Data/ReedSolomonEncoder.php + + - + rawMessage: ''' + Call to deprecated method getCoefficients() of class chillerlan\QRCode\Common\GenericGFPoly: + 6.0.1 This method will be removed. In v7, use the property "GenericGFPoly::$coefficients" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Data/ReedSolomonEncoder.php + + - + rawMessage: ''' + Call to deprecated method getHeight() of interface chillerlan\QRCode\Common\LuminanceSourceInterface: + 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$height" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Binarizer.php + + - + rawMessage: ''' + Call to deprecated method getLuminances() of interface chillerlan\QRCode\Common\LuminanceSourceInterface: + 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$luminances" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Binarizer.php + + - + rawMessage: ''' + Call to deprecated method getWidth() of interface chillerlan\QRCode\Common\LuminanceSourceInterface: + 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$width" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Binarizer.php + - rawMessage: 'Parameter #1 $maskPattern of method chillerlan\QRCode\Data\QRMatrix::mask() expects chillerlan\QRCode\Common\MaskPattern, chillerlan\QRCode\Common\MaskPattern|null given.' identifier: argument.type @@ -262,6 +565,42 @@ parameters: count: 1 path: src/Decoder/BitMatrix.php + - + rawMessage: ''' + Call to deprecated method getEccLevel() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Decoder.php + + - + rawMessage: ''' + Call to deprecated method getFinderPatterns() of class chillerlan\QRCode\Detector\Detector: + 6.0.1 This method will be removed. In v7, use the property "Detector::$finderPatterns" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Decoder.php + + - + rawMessage: ''' + Call to deprecated method getMaskPattern() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Decoder.php + + - + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Decoder/Decoder.php + - rawMessage: 'Method chillerlan\QRCode\Decoder\Decoder::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue @@ -286,12 +625,183 @@ parameters: count: 1 path: src/Decoder/ReedSolomonDecoder.php + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Detector/AlignmentPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 2 + path: src/Detector/Detector.php + + - + rawMessage: ''' + Call to deprecated method getX() of class chillerlan\QRCode\Detector\ResultPoint: + 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$x" instead. + ''' + identifier: method.deprecated + count: 16 + path: src/Detector/Detector.php + + - + rawMessage: ''' + Call to deprecated method getY() of class chillerlan\QRCode\Detector\ResultPoint: + 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$y" instead. + ''' + identifier: method.deprecated + count: 16 + path: src/Detector/Detector.php + + - + rawMessage: ''' + Call to deprecated method getCount() of class chillerlan\QRCode\Detector\FinderPattern: + 6.0.1 This method will be removed. In v7, use the property "FinderPattern::$count" instead. + ''' + identifier: method.deprecated + count: 2 + path: src/Detector/FinderPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getEstimatedModuleSize() of class chillerlan\QRCode\Detector\ResultPoint: + 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$estimatedModuleSize" instead. + ''' + identifier: method.deprecated + count: 6 + path: src/Detector/FinderPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 4 + path: src/Detector/FinderPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getX() of class chillerlan\QRCode\Detector\ResultPoint: + 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$x" instead. + ''' + identifier: method.deprecated + count: 5 + path: src/Detector/FinderPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getY() of class chillerlan\QRCode\Detector\ResultPoint: + 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$y" instead. + ''' + identifier: method.deprecated + count: 5 + path: src/Detector/FinderPatternFinder.php + + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Detector/GridSampler.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QREps.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRFpdf.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRFpdf.php + - rawMessage: 'Method chillerlan\QRCode\Output\QRFpdf::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue count: 1 path: src/Output/QRFpdf.php + - + rawMessage: ''' + Access to deprecated property $circleDiameter of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->circleRadius * 2` instead. + ''' + identifier: property.deprecated + count: 2 + path: src/Output/QRGdImage.php + + - + rawMessage: ''' + Access to deprecated property $drawCircularModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead. + ''' + identifier: property.deprecated + count: 2 + path: src/Output/QRGdImage.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRGdImage.php + + - + rawMessage: ''' + Access to deprecated property $keepAsSquare of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRGdImage.php + + - + rawMessage: ''' + Call to deprecated method copyVars() of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This method will be removed in v7 without replacement (unnecessary). + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRGdImage.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRGdImage.php + - rawMessage: 'Method chillerlan\QRCode\Output\QRGdImage::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue @@ -317,10 +827,49 @@ parameters: path: src/Output/QRGdImage.php - - rawMessage: 'Strict comparison using === between true and false will always evaluate to false.' - identifier: identical.alwaysFalse + rawMessage: ''' + Access to deprecated property $circleRadius of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->circleRadius` instead. + ''' + identifier: property.deprecated count: 1 - path: src/Output/QRGdImage.php + path: src/Output/QRImagick.php + + - + rawMessage: ''' + Access to deprecated property $drawCircularModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRImagick.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRImagick.php + + - + rawMessage: ''' + Access to deprecated property $keepAsSquare of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRImagick.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRImagick.php - rawMessage: 'Method chillerlan\QRCode\Output\QRImagick::__construct() has parameter $options with no value type specified in iterable type iterable.' @@ -328,12 +877,219 @@ parameters: count: 1 path: src/Output/QRImagick.php + - + rawMessage: ''' + Access to deprecated property $circleRadius of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->circleRadius` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRInterventionImage.php + + - + rawMessage: ''' + Access to deprecated property $drawCircularModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRInterventionImage.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRInterventionImage.php + + - + rawMessage: ''' + Access to deprecated property $keepAsSquare of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRInterventionImage.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRInterventionImage.php + - rawMessage: 'Method chillerlan\QRCode\Output\QRInterventionImage::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue count: 1 path: src/Output/QRInterventionImage.php + - + rawMessage: ''' + Access to deprecated property $eol of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->eol` instead. + ''' + identifier: property.deprecated + count: 3 + path: src/Output/QRMarkupHTML.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRMarkupHTML.php + + - + rawMessage: ''' + Access to deprecated property $circleDiameter of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->circleRadius * 2` instead. + ''' + identifier: property.deprecated + count: 2 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $circleRadius of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->circleRadius` instead. + ''' + identifier: property.deprecated + count: 5 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $drawCircularModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $eol of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->eol` instead. + ''' + identifier: property.deprecated + count: 6 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $keepAsSquare of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRMarkupSVG.php + + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRMarkupXML.php + + - + rawMessage: ''' + Call to deprecated method getEccLevel() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRMarkupXML.php + + - + rawMessage: ''' + Call to deprecated method getMaskPattern() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRMarkupXML.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRMarkupXML.php + + - + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated + count: 2 + path: src/Output/QRMarkupXML.php + + - + rawMessage: ''' + Access to deprecated property $connectPaths of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QROutputAbstract.php + + - + rawMessage: ''' + Access to deprecated property $excludeFromConnect of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QROutputAbstract.php + + - + rawMessage: ''' + Call to deprecated method copyVars() of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This method will be removed in v7 without replacement (unnecessary). + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QROutputAbstract.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QROutputAbstract.php + + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QROutputAbstract.php + - rawMessage: 'Method chillerlan\QRCode\Output\QROutputAbstract::__construct() has parameter $options with no value type specified in iterable type iterable.' identifier: missingType.iterableValue @@ -346,6 +1102,78 @@ parameters: count: 1 path: src/Output/QROutputAbstract.php + - + rawMessage: ''' + Access to deprecated property $drawLightModules of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRStringJSON.php + + - + rawMessage: ''' + Call to deprecated method getEccLevel() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRStringJSON.php + + - + rawMessage: ''' + Call to deprecated method getMaskPattern() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRStringJSON.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRStringJSON.php + + - + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRStringJSON.php + + - + rawMessage: ''' + Access to deprecated property $eol of class chillerlan\QRCode\Output\QROutputAbstract: + 6.0.1 This property will be removed in v7, use `$this->options->eol` instead. + ''' + identifier: property.deprecated + count: 1 + path: src/Output/QRStringText.php + + - + rawMessage: ''' + Call to deprecated method getMatrix() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/Output/QRStringText.php + + - + rawMessage: ''' + Call to deprecated method getID() of class chillerlan\QRCode\Common\ECICharset: + 6.0.1 This method will be removed. In v7, use the property "ECICharset::$charsetID" instead. + ''' + identifier: method.deprecated + count: 1 + path: src/QRCode.php + - rawMessage: PHPDoc tag @var with type chillerlan\QRCode\Data\QRDataModeInterface is not subtype of native type 'chillerlan\\QRCode\\Data\\AlphaNum'|'chillerlan\\QRCode\\Data\\Byte'|'chillerlan\\QRCode\\Data\\Hanzi'|'chillerlan\\QRCode\\Data\\Kanji'|'chillerlan\\QRCode\\Data\\Number'. identifier: varTag.nativeType @@ -358,12 +1186,93 @@ parameters: count: 1 path: src/QRCode.php + - + rawMessage: ''' + Call to deprecated method getBuffer() of class chillerlan\QRCode\Common\BitBuffer: + 6.0.1 This method will be removed in v7, use the property "BitBuffer::$buffer" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Common/BitBufferTest.php + + - + rawMessage: ''' + Call to deprecated method getLength() of class chillerlan\QRCode\Common\BitBuffer: + 6.0.1 This method will be removed. In v7, use the property "BitBuffer::$length" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Common/BitBufferTest.php + + - + rawMessage: ''' + Call to deprecated method getID() of class chillerlan\QRCode\Common\ECICharset: + 6.0.1 This method will be removed. In v7, use the property "ECICharset::$charsetID" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Common/ECICharsetTest.php + + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Common/EccLevelTest.php + - rawMessage: 'Method chillerlan\QRCodeTest\Common\MaskPatternTest::maskPatternProvider() return type has no value type specified in iterable type array.' identifier: missingType.iterableValue count: 1 path: tests/Common/MaskPatternTest.php + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Common/VersionTest.php + + - + rawMessage: ''' + Call to deprecated method getBitBuffer() of class chillerlan\QRCode\Data\QRData: + 6.0.1 This method will be removed. In v7, use the property "QRData::$bitBuffer" instead. + ''' + identifier: method.deprecated + count: 3 + path: tests/Data/DataInterfaceTestAbstract.php + + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 3 + path: tests/Data/DataInterfaceTestAbstract.php + + - + rawMessage: ''' + Call to deprecated method getMaskPattern() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Data/DataInterfaceTestAbstract.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 6 + path: tests/Data/DataInterfaceTestAbstract.php + - rawMessage: 'Method chillerlan\QRCodeTest\Data\DataInterfaceTestAbstract::maxLengthProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn' identifier: missingType.generics @@ -376,6 +1285,24 @@ parameters: count: 1 path: tests/Data/DataInterfaceTestAbstract.php + - + rawMessage: ''' + Call to deprecated method getBitBuffer() of class chillerlan\QRCode\Data\QRData: + 6.0.1 This method will be removed. In v7, use the property "QRData::$bitBuffer" instead. + ''' + identifier: method.deprecated + count: 3 + path: tests/Data/ECITest.php + + - + rawMessage: ''' + Call to deprecated method getID() of class chillerlan\QRCode\Common\ECICharset: + 6.0.1 This method will be removed. In v7, use the property "ECICharset::$charsetID" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Data/ECITest.php + - rawMessage: 'Parameter #1 $data of class chillerlan\QRCode\Data\Byte constructor expects string|null, string|false given.' identifier: argument.type @@ -401,10 +1328,22 @@ parameters: path: tests/Data/KanjiTest.php - - rawMessage: 'Parameter #1 $codepoint of function chr expects int<0, 255>, int given.' - identifier: argument.type + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated count: 2 - path: tests/Data/KanjiTest.php + path: tests/Data/QRDataTest.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Data/QRDataTest.php - rawMessage: 'Parameter #1 $blob of method chillerlan\QRCode\QRCode::readFromBlob() expects string, GdImage|string given.' @@ -412,12 +1351,84 @@ parameters: count: 1 path: tests/Data/QRDataTest.php + - + rawMessage: ''' + Call to deprecated method getEccLevel() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Data/QRMatrixTest.php + + - + rawMessage: ''' + Call to deprecated method getMaskPattern() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. + ''' + identifier: method.deprecated + count: 2 + path: tests/Data/QRMatrixTest.php + + - + rawMessage: ''' + Call to deprecated method getPattern() of class chillerlan\QRCode\Common\MaskPattern: + 6.0.1 This method will be removed. In v7, use the property "MaskPattern::$currentPattern" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/Data/QRMatrixTest.php + + - + rawMessage: ''' + Call to deprecated method getSize() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. + ''' + identifier: method.deprecated + count: 16 + path: tests/Data/QRMatrixTest.php + + - + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated + count: 5 + path: tests/Data/QRMatrixTest.php + - rawMessage: 'Method chillerlan\QRCodeTest\Data\QRMatrixTest::matrixProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn' identifier: missingType.generics count: 1 path: tests/Data/QRMatrixTest.php + - + rawMessage: ''' + Call to deprecated method getLevel() of class chillerlan\QRCode\Common\EccLevel: + 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. + ''' + identifier: method.deprecated + count: 3 + path: tests/QRCodeReaderTestAbstract.php + + - + rawMessage: ''' + Call to deprecated method getVersion() of class chillerlan\QRCode\Data\QRMatrix: + 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. + ''' + identifier: method.deprecated + count: 1 + path: tests/QRCodeReaderTestAbstract.php + + - + rawMessage: ''' + Call to deprecated method getVersionNumber() of class chillerlan\QRCode\Common\Version: + 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. + ''' + identifier: method.deprecated + count: 4 + path: tests/QRCodeReaderTestAbstract.php + - rawMessage: 'Method chillerlan\QRCodeTest\QRCodeReaderTestAbstract::dataTestProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn' identifier: missingType.generics diff --git a/src/Common/BitBuffer.php b/src/Common/BitBuffer.php index 480340b99..328ee5c3e 100644 --- a/src/Common/BitBuffer.php +++ b/src/Common/BitBuffer.php @@ -84,6 +84,8 @@ final class BitBuffer{ /** * returns the current buffer length + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "BitBuffer::$length" instead. */ public function getLength():int{ return $this->length; @@ -95,6 +97,8 @@ final class BitBuffer{ * to debug: `array_map(fn($v) => sprintf('%08b', $v), $bitBuffer->getBuffer())` * * @return int[] + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "BitBuffer::$buffer" instead. */ public function getBuffer():array{ return $this->buffer; diff --git a/src/Common/ECICharset.php b/src/Common/ECICharset.php index d6f78b743..18a3336cc 100644 --- a/src/Common/ECICharset.php +++ b/src/Common/ECICharset.php @@ -108,6 +108,7 @@ final class ECICharset{ /** * Returns the current character set ID + * @deprecated 6.0.1 This method will be removed. In v7, use the property "ECICharset::$charsetID" instead. */ public function getID():int{ return $this->charsetID; diff --git a/src/Common/EccLevel.php b/src/Common/EccLevel.php index ae7720433..07ec9066d 100644 --- a/src/Common/EccLevel.php +++ b/src/Common/EccLevel.php @@ -138,7 +138,7 @@ final class EccLevel{ * Q: 0b11 * H: 0b10 */ - private int $eccLevel; + private int $level; /** * @param int $eccLevel containing the two bits encoding a QR Code's error correction level @@ -151,7 +151,7 @@ final class EccLevel{ throw new QRCodeException('invalid ECC level'); } - $this->eccLevel = $eccLevel; + $this->level = $eccLevel; } /** @@ -163,14 +163,16 @@ final class EccLevel{ self::M => 'M', self::Q => 'Q', self::H => 'H', - ][$this->eccLevel]; + ][$this->level]; } /** * returns the current ECC level + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead. */ public function getLevel():int{ - return $this->eccLevel; + return $this->level; } /** @@ -188,7 +190,7 @@ final class EccLevel{ self::M => 1, self::Q => 2, self::H => 3, - ][$this->eccLevel]; + ][$this->level]; } /** diff --git a/src/Common/GenericGFPoly.php b/src/Common/GenericGFPoly.php index 5c0b63b87..f4768ec6b 100644 --- a/src/Common/GenericGFPoly.php +++ b/src/Common/GenericGFPoly.php @@ -77,6 +77,8 @@ final class GenericGFPoly{ /** * @return int[] + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "GenericGFPoly::$coefficients" instead. */ public function getCoefficients():array{ return $this->coefficients; diff --git a/src/Common/LuminanceSourceInterface.php b/src/Common/LuminanceSourceInterface.php index 621d85924..b0a7c3c7f 100644 --- a/src/Common/LuminanceSourceInterface.php +++ b/src/Common/LuminanceSourceInterface.php @@ -26,16 +26,22 @@ interface LuminanceSourceInterface{ * @return int[] A row-major 2D array of luminance values. Do not use result $length as it may be * larger than $width * $height bytes on some platforms. Do not modify the contents * of the result. + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$luminances" instead. */ public function getLuminances():array; /** * @return int The width of the bitmap. + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$width" instead. */ public function getWidth():int; /** * @return int The height of the bitmap. + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$height" instead. */ public function getHeight():int; diff --git a/src/Common/MaskPattern.php b/src/Common/MaskPattern.php index 106fc5922..e61bac6bb 100644 --- a/src/Common/MaskPattern.php +++ b/src/Common/MaskPattern.php @@ -69,7 +69,7 @@ final class MaskPattern{ /** * The current mask pattern value (0-7) */ - private int $maskPattern; + private int $currentPattern; /** * MaskPattern constructor. @@ -82,14 +82,16 @@ final class MaskPattern{ throw new QRCodeException('invalid mask pattern'); } - $this->maskPattern = $maskPattern; + $this->currentPattern = $maskPattern; } /** * Returns the current mask pattern + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "MaskPattern::$currentPattern" instead. */ public function getPattern():int{ - return $this->maskPattern; + return $this->currentPattern; } /** @@ -112,7 +114,7 @@ final class MaskPattern{ self::PATTERN_101 => fn(int $x, int $y):bool => (($x * $y) % 6) === 0, self::PATTERN_110 => fn(int $x, int $y):bool => (($x * $y) % 6) < 3, self::PATTERN_111 => fn(int $x, int $y):bool => (($x + $y + (($x * $y) % 3)) % 2) === 0, - ][$this->maskPattern]; + ][$this->currentPattern]; } /** diff --git a/src/Common/Version.php b/src/Common/Version.php index 7c5938527..bff3c58c9 100644 --- a/src/Common/Version.php +++ b/src/Common/Version.php @@ -218,7 +218,7 @@ final class Version{ /** * QR Code version number */ - private int $version; + private int $versionNumber; /** * Version constructor. @@ -231,35 +231,37 @@ final class Version{ throw new QRCodeException('invalid version given'); } - $this->version = $version; + $this->versionNumber = $version; } /** * returns the current version number as string */ public function __toString():string{ - return (string)$this->version; + return (string)$this->versionNumber; } /** * returns the current version number + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead. */ public function getVersionNumber():int{ - return $this->version; + return $this->versionNumber; } /** * the matrix size for the given version */ public function getDimension():int{ - return (($this->version * 4) + 17); + return (($this->versionNumber * 4) + 17); } /** * the version pattern for the given version */ public function getVersionPattern():int|null{ - return (self::VERSION_PATTERN[$this->version] ?? null); + return (self::VERSION_PATTERN[$this->versionNumber] ?? null); } /** @@ -268,21 +270,21 @@ final class Version{ * @return int[] */ public function getAlignmentPattern():array{ - return self::ALIGNMENT_PATTERN[$this->version]; + return self::ALIGNMENT_PATTERN[$this->versionNumber]; } /** * returns ECC block information for the given $version and $eccLevel */ public function getRSBlocks(EccLevel $eccLevel):array{ - return self::RSBLOCKS[$this->version][$eccLevel->getOrdinal()]; + return self::RSBLOCKS[$this->versionNumber][$eccLevel->getOrdinal()]; } /** * returns the maximum codewords for the current version */ public function getTotalCodewords():int{ - return self::TOTAL_CODEWORDS[$this->version]; + return self::TOTAL_CODEWORDS[$this->versionNumber]; } } diff --git a/src/Data/QRData.php b/src/Data/QRData.php index 65e46c5b7..37d743a51 100644 --- a/src/Data/QRData.php +++ b/src/Data/QRData.php @@ -87,6 +87,7 @@ final class QRData{ /** * Returns the current BitBuffer instance * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "QRData::$bitBuffer" instead. * @codeCoverageIgnore */ public function getBitBuffer():BitBuffer{ diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index e338d8208..4d39183aa 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -12,13 +12,20 @@ declare(strict_types=1); namespace chillerlan\QRCode\Data; use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Version}; -use function array_fill, array_map, array_reverse, count, intdiv; +use chillerlan\QRCode\QRCodeException; +use function array_fill, array_map, array_reverse, count, intdiv, in_array; /** * Holds an array representation of the final QR Code that contains numerical values for later output modifications; * maps the ECC coded binary data and applies the mask pattern * * @see http://www.thonky.com/qr-code-tutorial/format-version-information + * + * @property Version|null $version + * @property EccLevel|null $eccLevel + * @property MaskPattern|null $maskPattern + * @property int $moduleCount + * @property int[][] $matrix */ class QRMatrix{ @@ -149,6 +156,22 @@ class QRMatrix{ $this->matrix = $this->createMatrix($this->moduleCount, $this::M_NULL); } + /** + * This magic getter serves as an upgrade path for the deprecated property getter methods, + * which will be removed in v7 in favor of asymmetric visibility (PHP 8.4+). + * + * @throws \chillerlan\QRCode\QRCodeException + * @codeCoverageIgnore + */ + public function __get(string $name):mixed{ + + if(in_array($name, ['matrix', 'version', 'eccLevel', 'maskPattern', 'moduleCount'], true)){ + return $this->{$name}; + } + + throw new QRCodeException('invalid property access'); + } + /** * Creates a 2-dimensional array (square) of the given $size * @@ -177,6 +200,8 @@ class QRMatrix{ * Returns the data matrix * * @return int[][] + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead. */ public function getMatrix():array{ return $this->matrix; @@ -200,6 +225,8 @@ class QRMatrix{ /** * Returns the current version number + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead. */ public function getVersion():Version|null{ return $this->version; @@ -207,6 +234,8 @@ class QRMatrix{ /** * Returns the current ECC level + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead. */ public function getEccLevel():EccLevel|null{ return $this->eccLevel; @@ -214,6 +243,8 @@ class QRMatrix{ /** * Returns the current mask pattern + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead. */ public function getMaskPattern():MaskPattern|null{ return $this->maskPattern; @@ -223,6 +254,8 @@ class QRMatrix{ * Returns the absoulute size of the matrix, including quiet zone (after setting it). * * size = version * 4 + 17 [ + 2 * quietzone size] + * + * @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead. */ public function getSize():int{ return $this->moduleCount; diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index e66fe398c..091c4a11b 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -38,6 +38,8 @@ final class Detector{ /** * @return \chillerlan\QRCode\Detector\FinderPattern[] + * + * @deprecated 6.0.1 This method will be removed. In v7, use the property "Detector::$finderPatterns" instead. */ public function getFinderPatterns():array{ return $this->finderPatterns; diff --git a/src/Detector/FinderPattern.php b/src/Detector/FinderPattern.php index 8372956ca..4443464b5 100644 --- a/src/Detector/FinderPattern.php +++ b/src/Detector/FinderPattern.php @@ -31,6 +31,9 @@ final class FinderPattern extends ResultPoint{ $this->count = ($count ?? 1); } + /** + * @deprecated 6.0.1 This method will be removed. In v7, use the property "FinderPattern::$count" instead. + */ public function getCount():int{ return $this->count; } diff --git a/src/Detector/ResultPoint.php b/src/Detector/ResultPoint.php index 8f3432a88..870cd237a 100644 --- a/src/Detector/ResultPoint.php +++ b/src/Detector/ResultPoint.php @@ -32,14 +32,23 @@ abstract class ResultPoint{ $this->estimatedModuleSize = $estimatedModuleSize; } + /** + * @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$x" instead. + */ public function getX():float{ return $this->x; } + /** + * @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$y" instead. + */ public function getY():float{ return $this->y; } + /** + * @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$estimatedModuleSize" instead. + */ public function getEstimatedModuleSize():float{ return $this->estimatedModuleSize; } diff --git a/src/Output/QROutputAbstract.php b/src/Output/QROutputAbstract.php index 7770bce50..354aaa151 100644 --- a/src/Output/QROutputAbstract.php +++ b/src/Output/QROutputAbstract.php @@ -37,6 +37,13 @@ abstract class QROutputAbstract implements QROutputInterface{ */ protected int $length; + /** + * The current module scale value (might have been modified) + * + * @see \chillerlan\QRCode\QROptions::$scale + */ + protected int $scale; + /** * an (optional) array of color values for the several QR matrix parts * @@ -57,25 +64,50 @@ abstract class QROutputAbstract implements QROutputInterface{ /** * @see \chillerlan\QRCode\QROptions::$excludeFromConnect * @var int[] + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead. */ protected array $excludeFromConnect; + /** * @see \chillerlan\QRCode\QROptions::$keepAsSquare * @var int[] + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead. */ protected array $keepAsSquare; - /** @see \chillerlan\QRCode\QROptions::$scale */ - protected int $scale; - /** @see \chillerlan\QRCode\QROptions::$connectPaths */ + + /** + * @see \chillerlan\QRCode\QROptions::$connectPaths + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead. + */ protected bool $connectPaths; - /** @see \chillerlan\QRCode\QROptions::$eol */ + + /** + * @see \chillerlan\QRCode\QROptions::$eol + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->eol` instead. + */ protected string $eol; - /** @see \chillerlan\QRCode\QROptions::$drawLightModules */ + + /** + * @see \chillerlan\QRCode\QROptions::$drawLightModules + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead. + */ protected bool $drawLightModules; - /** @see \chillerlan\QRCode\QROptions::$drawCircularModules */ + + /** + * @see \chillerlan\QRCode\QROptions::$drawCircularModules + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead. + */ protected bool $drawCircularModules; - /** @see \chillerlan\QRCode\QROptions::$circleRadius */ + + /** + * @see \chillerlan\QRCode\QROptions::$circleRadius + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->circleRadius` instead. + */ protected float $circleRadius; + + /** + * @deprecated 6.0.1 This property will be removed in v7, use `$this->options->circleRadius * 2` instead. + */ protected float $circleDiameter; /** @@ -104,6 +136,8 @@ abstract class QROutputAbstract implements QROutputInterface{ * in long loops for a significant performance increase. * * These variables are usually used in the "module" methods and are called up to 31329 times (at version 40). + * + * @deprecated 6.0.1 This method will be removed in v7 without replacement (unnecessary). */ protected function copyVars():void{ @@ -127,7 +161,7 @@ abstract class QROutputAbstract implements QROutputInterface{ /** * Sets/updates the matrix dimensions * - * Call this method if you modify the matrix from within your custom module in case the dimensions have been changed + * Call this method if you modify the matrix from within your custom output class in case the dimensions have been changed */ protected function setMatrixDimensions():void{ $this->moduleCount = $this->matrix->getSize();