Sfoglia il codice sorgente

:octocat: moved some files

smiley 2 anni fa
parent
commit
ff147426a1

+ 2 - 2
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

+ 2 - 1
src/Decoder/GDLuminanceSource.php → 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;

+ 1 - 1
src/Decoder/IMagickLuminanceSource.php → src/Common/IMagickLuminanceSource.php

@@ -11,7 +11,7 @@
  * @noinspection PhpComposerExtensionStubsInspection
  */
 
-namespace chillerlan\QRCode\Decoder;
+namespace chillerlan\QRCode\Common;
 
 use chillerlan\Settings\SettingsContainerInterface;
 use Imagick;

+ 2 - 1
src/Decoder/LuminanceSourceAbstract.php → 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;

+ 1 - 1
src/Decoder/LuminanceSourceInterface.php → src/Common/LuminanceSourceInterface.php

@@ -8,7 +8,7 @@
  * @license      MIT
  */
 
-namespace chillerlan\QRCode\Decoder;
+namespace chillerlan\QRCode\Common;
 
 /**
  */

+ 1 - 1
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;
 
 /**

+ 2 - 1
src/Common/ReedSolomonEncoder.php → 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;
 
 /**

+ 1 - 0
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;
 

+ 1 - 1
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;

+ 2 - 1
src/Common/ReedSolomonDecoder.php → 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;
 

+ 2 - 2
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;

+ 6 - 5
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;

+ 1 - 1
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

+ 1 - 1
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;