diff --git a/NOTICE b/NOTICE index 6e65c8838..596130bf7 100644 --- a/NOTICE +++ b/NOTICE @@ -22,13 +22,13 @@ List of affected files: src/Common/ECICharset.php src/Common/GenericGFPoly.php src/Common/GF256.php +src/Common/LuminanceSourceAbstract.php src/Common/MaskPattern.php -src/Common/ReedSolomonDecoder.php src/Decoder/Binarizer.php src/Decoder/BitMatrix.php src/Decoder/Decoder.php src/Decoder/DecoderResult.php -src/Decoder/LuminanceSourceAbstract.php +src/Decoder/ReedSolomonDecoder.php src/Detector/AlignmentPattern.php src/Detector/AlignmentPatternFinder.php src/Detector/Detector.php diff --git a/src/Decoder/GDLuminanceSource.php b/src/Common/GDLuminanceSource.php similarity index 96% rename from src/Decoder/GDLuminanceSource.php rename to src/Common/GDLuminanceSource.php index 4e892ae93..027466f3e 100644 --- a/src/Decoder/GDLuminanceSource.php +++ b/src/Common/GDLuminanceSource.php @@ -11,8 +11,9 @@ * @noinspection PhpComposerExtensionStubsInspection */ -namespace chillerlan\QRCode\Decoder; +namespace chillerlan\QRCode\Common; +use chillerlan\QRCode\Decoder\QRCodeDecoderException; use chillerlan\Settings\SettingsContainerInterface; use function file_get_contents, get_resource_type, imagecolorat, imagecolorsforindex, imagecreatefromstring, imagefilter, imagesx, imagesy, is_resource; diff --git a/src/Decoder/IMagickLuminanceSource.php b/src/Common/IMagickLuminanceSource.php similarity index 98% rename from src/Decoder/IMagickLuminanceSource.php rename to src/Common/IMagickLuminanceSource.php index 349118910..d4f66c5c2 100644 --- a/src/Decoder/IMagickLuminanceSource.php +++ b/src/Common/IMagickLuminanceSource.php @@ -11,7 +11,7 @@ * @noinspection PhpComposerExtensionStubsInspection */ -namespace chillerlan\QRCode\Decoder; +namespace chillerlan\QRCode\Common; use chillerlan\Settings\SettingsContainerInterface; use Imagick; diff --git a/src/Decoder/LuminanceSourceAbstract.php b/src/Common/LuminanceSourceAbstract.php similarity index 96% rename from src/Decoder/LuminanceSourceAbstract.php rename to src/Common/LuminanceSourceAbstract.php index 0742440f6..432a6e0d4 100644 --- a/src/Decoder/LuminanceSourceAbstract.php +++ b/src/Common/LuminanceSourceAbstract.php @@ -10,8 +10,9 @@ * @license Apache-2.0 */ -namespace chillerlan\QRCode\Decoder; +namespace chillerlan\QRCode\Common; +use chillerlan\QRCode\Decoder\QRCodeDecoderException; use chillerlan\QRCode\QROptions; use chillerlan\Settings\SettingsContainerInterface; use function array_slice, array_splice, file_exists, is_file, is_readable, realpath; diff --git a/src/Decoder/LuminanceSourceInterface.php b/src/Common/LuminanceSourceInterface.php similarity index 97% rename from src/Decoder/LuminanceSourceInterface.php rename to src/Common/LuminanceSourceInterface.php index 84f8cfde5..64409e36a 100644 --- a/src/Decoder/LuminanceSourceInterface.php +++ b/src/Common/LuminanceSourceInterface.php @@ -8,7 +8,7 @@ * @license MIT */ -namespace chillerlan\QRCode\Decoder; +namespace chillerlan\QRCode\Common; /** */ diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index 4768679db..6d1c13a7b 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -10,7 +10,7 @@ namespace chillerlan\QRCode\Data; -use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, ReedSolomonEncoder, Version}; +use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Version}; use function array_fill, array_map, array_reverse, count, intdiv; /** diff --git a/src/Common/ReedSolomonEncoder.php b/src/Data/ReedSolomonEncoder.php similarity index 96% rename from src/Common/ReedSolomonEncoder.php rename to src/Data/ReedSolomonEncoder.php index 4fcdbde45..30cbd22a8 100644 --- a/src/Common/ReedSolomonEncoder.php +++ b/src/Data/ReedSolomonEncoder.php @@ -8,8 +8,9 @@ * @license MIT */ -namespace chillerlan\QRCode\Common; +namespace chillerlan\QRCode\Data; +use chillerlan\QRCode\Common\{BitBuffer, EccLevel, GenericGFPoly, GF256, Version}; use function array_fill, array_merge, count, max; /** diff --git a/src/Decoder/Binarizer.php b/src/Decoder/Binarizer.php index fe90792a6..7b7b49f65 100644 --- a/src/Decoder/Binarizer.php +++ b/src/Decoder/Binarizer.php @@ -11,6 +11,7 @@ namespace chillerlan\QRCode\Decoder; +use chillerlan\QRCode\Common\LuminanceSourceInterface; use chillerlan\QRCode\Data\QRMatrix; use function array_fill, count, intdiv, max; diff --git a/src/Decoder/Decoder.php b/src/Decoder/Decoder.php index 87a09e939..6f369a6df 100644 --- a/src/Decoder/Decoder.php +++ b/src/Decoder/Decoder.php @@ -11,7 +11,7 @@ namespace chillerlan\QRCode\Decoder; -use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Mode, ReedSolomonDecoder, Version}; +use chillerlan\QRCode\Common\{BitBuffer, EccLevel, LuminanceSourceInterface, MaskPattern, Mode, Version}; use chillerlan\QRCode\Data\{AlphaNum, Byte, ECI, Hanzi, Kanji, Number}; use chillerlan\QRCode\Detector\Detector; use Throwable; diff --git a/src/Common/ReedSolomonDecoder.php b/src/Decoder/ReedSolomonDecoder.php similarity index 98% rename from src/Common/ReedSolomonDecoder.php rename to src/Decoder/ReedSolomonDecoder.php index f9351fae6..ec6ac9dd7 100644 --- a/src/Common/ReedSolomonDecoder.php +++ b/src/Decoder/ReedSolomonDecoder.php @@ -9,8 +9,9 @@ * @license Apache-2.0 */ -namespace chillerlan\QRCode\Common; +namespace chillerlan\QRCode\Decoder; +use chillerlan\QRCode\Common\{BitBuffer, EccLevel, GenericGFPoly, GF256, Version}; use chillerlan\QRCode\QRCodeException; use function array_fill, array_reverse, count; diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index 37c2e31b3..949aebd53 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -11,8 +11,8 @@ namespace chillerlan\QRCode\Detector; -use chillerlan\QRCode\Decoder\{Binarizer, LuminanceSourceInterface}; -use chillerlan\QRCode\Common\Version; +use chillerlan\QRCode\Decoder\Binarizer; +use chillerlan\QRCode\Common\{LuminanceSourceInterface, Version}; use chillerlan\QRCode\Decoder\BitMatrix; use function abs, intdiv, is_nan, max, min, round; use const NAN; diff --git a/src/QRCode.php b/src/QRCode.php index 2a6d66452..b5ccea9d3 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -12,11 +12,11 @@ namespace chillerlan\QRCode; -use chillerlan\QRCode\Common\{EccLevel, ECICharset, MaskPattern, Mode, Version}; -use chillerlan\QRCode\Data\{ - AlphaNum, Byte, ECI, Hanzi, Kanji, Number, QRData, QRDataModeInterface, QRMatrix +use chillerlan\QRCode\Common\{ + EccLevel, ECICharset, GDLuminanceSource, IMagickLuminanceSource, LuminanceSourceInterface, MaskPattern, Mode, Version }; -use chillerlan\QRCode\Decoder\{Decoder, DecoderResult, GDLuminanceSource, IMagickLuminanceSource, LuminanceSourceInterface}; +use chillerlan\QRCode\Data\{AlphaNum, Byte, ECI, Hanzi, Kanji, Number, QRData, QRDataModeInterface, QRMatrix}; +use chillerlan\QRCode\Decoder\{Decoder, DecoderResult}; use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface}; use chillerlan\Settings\SettingsContainerInterface; use function class_exists, class_implements, in_array, mb_convert_encoding, mb_internal_encoding; @@ -292,7 +292,8 @@ class QRCode{ * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ protected function initOutputInterface(QRMatrix $matrix):QROutputInterface{ - $outputInterface =( QROutputInterface::MODES[$this->options->outputType] ?? null); + // @todo: remove custom invocation in v6 + $outputInterface = (QROutputInterface::MODES[$this->options->outputType] ?? null); if($this->options->outputType === QROutputInterface::CUSTOM){ $outputInterface = $this->options->outputInterface; diff --git a/tests/QRCodeReaderGDTest.php b/tests/QRCodeReaderGDTest.php index 4d5b4f8f5..25a893723 100644 --- a/tests/QRCodeReaderGDTest.php +++ b/tests/QRCodeReaderGDTest.php @@ -10,7 +10,7 @@ namespace chillerlan\QRCodeTest; -use chillerlan\QRCode\Decoder\GDLuminanceSource; +use chillerlan\QRCode\Common\GDLuminanceSource; /** * Tests the GD based reader diff --git a/tests/QRCodeReaderImagickTest.php b/tests/QRCodeReaderImagickTest.php index 4faea0a27..b52092383 100644 --- a/tests/QRCodeReaderImagickTest.php +++ b/tests/QRCodeReaderImagickTest.php @@ -10,7 +10,7 @@ namespace chillerlan\QRCodeTest; -use chillerlan\QRCode\Decoder\IMagickLuminanceSource; +use chillerlan\QRCode\Common\IMagickLuminanceSource; use chillerlan\QRCode\QRCode; use function extension_loaded; use const PHP_OS_FAMILY, PHP_VERSION_ID;