smiley 2 年 前
コミット
4461699a83

+ 6 - 5
README.md

@@ -38,12 +38,13 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
   - numeric
   - alphanumeric
   - 8-bit binary
+    - [ECI support](https://en.wikipedia.org/wiki/Extended_Channel_Interpretation)
   - 13-bit double-byte:
     - kanji (Japanese, Shift-JIS)
     - hanzi (simplified Chinese, GB2312/GB18030) as [defined in GBT18284-2000](https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000)
 - Flexible, easily extensible output modules, built-in support for the following output formats:
-  - [GdImage](https://www.php.net/manual/book.image)
-  - [ImageMagick](https://www.php.net/manual/book.imagick)
+  - [GdImage](https://www.php.net/manual/book.image) (raster graphics: avif, bmp, gif, jpeg, png, webp)
+  - [ImageMagick](https://www.php.net/manual/book.imagick) ([multiple supported image formats](https://imagemagick.org/script/formats.php))
   - Markup types: SVG, HTML, etc.
   - String types: JSON, plain text, etc.
   - Encapsulated Postscript (EPS)
@@ -53,7 +54,7 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
 
 ### Requirements
 
-- PHP 7.4+
+- PHP 8.2+
   - [`ext-mbstring`](https://www.php.net/manual/book.mbstring.php)
   - optional:
     - [`ext-gd`](https://www.php.net/manual/book.image)
@@ -88,13 +89,13 @@ composer require chillerlan/php-qrcode
 ```json
 {
 	"require": {
-		"php": "^7.4 || ^8.0",
+		"php": "^^8.2",
 		"chillerlan/php-qrcode": "dev-main#<commit_hash>"
 	}
 }
 ```
 
-Note: replace `dev-main` with a [version constraint](https://getcomposer.org/doc/articles/versions.md#writing-version-constraints), e.g. `^4.3` - see [releases](https://github.com/chillerlan/php-qrcode/releases) for valid versions.
+Note: replace `dev-main` with a [version constraint](https://getcomposer.org/doc/articles/versions.md#writing-version-constraints), e.g. `^5.0` - see [releases](https://github.com/chillerlan/php-qrcode/releases) for valid versions.
 
 
 ## Quickstart

+ 1 - 1
docs/Built-In-Output/QREps.md

@@ -12,7 +12,7 @@ Set the options:
 ```php
 $options = new QROptions;
 
-$options->outputType       = QROutputInterface::EPS;
+$options->outputInterface  = QREps::class;
 $options->scale            = 5;
 $options->drawLightModules = false;
 // colors can be specified either as [R, G, B] or [C, M, Y, K] (0-255)

+ 1 - 1
docs/Built-In-Output/QRFpdf.md

@@ -12,7 +12,7 @@ Set the options:
 ```php
 $options = new QROptions;
 
-$options->outputType       = QROutputInterface::FPDF;
+$options->outputInterface  = QRFpdf::class;
 $options->scale            = 5;
 $options->fpdfMeasureUnit  = 'mm'; // pt, mm, cm, in
 $options->bgColor          = [222, 222, 222]; // [R, G, B]

+ 3 - 2
docs/Built-In-Output/QRGdImage.md

@@ -8,11 +8,12 @@
 See: [GdImage example](https://github.com/chillerlan/php-qrcode/blob/main/examples/image.php)
 
 Set the options:
+
 ```php
 $options = new QROptions;
 
-// $outputType can be one of: GDIMAGE_BMP, GDIMAGE_GIF, GDIMAGE_JPG, GDIMAGE_PNG, GDIMAGE_WEBP
-$options->outputType          = QROutputInterface::GDIMAGE_WEBP;
+// $outputInterface can be one of the classes listed in `QROutputInterface::MODES`
+$options->outputInterface     = QRGdImageWEBP::class;
 $options->quality             = 90;
 // the size of one qr module in pixels
 $options->scale               = 20;

+ 2 - 1
docs/Built-In-Output/QRImagick.md

@@ -14,10 +14,11 @@ Please follow the installation guides for your operating system:
 See: [ImageMagick example](https://github.com/chillerlan/php-qrcode/blob/main/examples/imagick.php)
 
 Set the options:
+
 ```php
 $options = new QROptions;
 
-$options->outputType          = QROutputInterface::IMAGICK;
+$options->outputInterface     = QRImagick::class;
 $options->imagickFormat       = 'webp'; // e.g. png32, jpeg, webp
 $options->quality             = 90;
 $options->scale               = 20;

+ 3 - 3
docs/Built-In-Output/QRMarkupHTML.md

@@ -15,9 +15,9 @@ Set the options:
 ```php
 $options = new QROptions;
 
-$options->outputType   = QROutputInterface::MARKUP_HTML;
-$options->cssClass     = 'qrcode';
-$options->moduleValues = [
+$options->outputInterface = QRMarkupHTML::class;
+$options->cssClass        = 'qrcode';
+$options->moduleValues    = [
 	// finder
 	QRMatrix::M_FINDER_DARK    => '#A71111', // dark (true)
 	QRMatrix::M_FINDER_DOT     => '#A71111', // finder dot, dark (true)

+ 1 - 1
docs/Built-In-Output/QRMarkupSVG.md

@@ -12,7 +12,7 @@ Set the options:
 $options = new QROptions;
 
 $options->version              = 7;
-$options->outputType           = QROutputInterface::MARKUP_SVG;
+$options->outputInterface      = QRMarkupSVG::class;
 // if set to false, the light modules won't be rendered
 $options->drawLightModules     = true;
 $options->svgUseFillAttributes = true;

+ 13 - 13
docs/Built-In-Output/QRString.md

@@ -17,21 +17,21 @@ function ansi8(string $str, int $color, bool $background = false):string{
 
 $options = new QROptions;
 
-$options->outputType     = QROutputInterface::STRING_TEXT;
-$options->eol            = "\n";
+$options->outputInterface = QRStringText::class;
+$options->eol             = "\n";
 // add some space on the line start
-$options->textLineStart  = str_repeat(' ', 6);
+$options->textLineStart   = str_repeat(' ', 6);
 // default values for unassigned module types
-$options->textDark       = QRString::ansi8('██', 253);
-$options->textLight      = QRString::ansi8('░░', 253);
-$options->moduleValues   = [
-	QRMatrix::M_FINDER_DARK    => QRString::ansi8('██', 124),
-	QRMatrix::M_FINDER         => QRString::ansi8('░░', 124),
-	QRMatrix::M_FINDER_DOT     => QRString::ansi8('██', 124),
-	QRMatrix::M_ALIGNMENT_DARK => QRString::ansi8('██', 2),
-	QRMatrix::M_ALIGNMENT      => QRString::ansi8('░░', 2),
-	QRMatrix::M_VERSION_DARK   => QRString::ansi8('██', 21),
-	QRMatrix::M_VERSION        => QRString::ansi8('░░', 21),
+$options->textDark        = QRStringText::ansi8('██', 253);
+$options->textLight       = QRStringText::ansi8('░░', 253);
+$options->moduleValues    = [
+	QRMatrix::M_FINDER_DARK    => QRStringText::ansi8('██', 124),
+	QRMatrix::M_FINDER         => QRStringText::ansi8('░░', 124),
+	QRMatrix::M_FINDER_DOT     => QRStringText::ansi8('██', 124),
+	QRMatrix::M_ALIGNMENT_DARK => QRStringText::ansi8('██', 2),
+	QRMatrix::M_ALIGNMENT      => QRStringText::ansi8('░░', 2),
+	QRMatrix::M_VERSION_DARK   => QRStringText::ansi8('██', 21),
+	QRMatrix::M_VERSION        => QRStringText::ansi8('░░', 21),
 ];
 ```
 

+ 18 - 86
docs/Usage/Configuration-settings.md

@@ -30,13 +30,15 @@ if `QROptions::$version` is set to `Version::AUTO` (default: 40)
 
 Error correct level
 
-`EccLevel::X` where `X` is:
+the constant `EccLevel::X` where `X` is:
 
 - `L` =>  7% (default)
 - `M` => 15%
 - `Q` => 25%
 - `H` => 30%
 
+alternatively you can just pass the letters L/M/Q/H (case-insensitive) to the magic setter
+
 
 **See also:**
 
@@ -73,47 +75,9 @@ Size of the quiet zone
 internally clamped to `0 ... $moduleCount / 2` (default: 4)
 
 
-## outputType
-
-The built-in output type
-
-- `QROutputInterface::MARKUP_SVG` (default)
-- `QROutputInterface::MARKUP_HTML`
-- `QROutputInterface::GDIMAGE_BMP`
-- `QROutputInterface::GDIMAGE_GIF`
-- `QROutputInterface::GDIMAGE_JPG`
-- `QROutputInterface::GDIMAGE_PNG`
-- `QROutputInterface::GDIMAGE_WEBP`
-- `QROutputInterface::STRING_TEXT`
-- `QROutputInterface::STRING_JSON`
-- `QROutputInterface::IMAGICK`
-- `QROutputInterface::EPS`
-- `QROutputInterface::FPDF`
-- `QROutputInterface::CUSTOM`
-
-
-**Deprecated:** 5.0.0 see issue #223
-
-**See also:**
-
-- `\chillerlan\QRCode\Output\QREps`
-- `\chillerlan\QRCode\Output\QRFpdf`
-- `\chillerlan\QRCode\Output\QRGdImage`
-- `\chillerlan\QRCode\Output\QRImagick`
-- `\chillerlan\QRCode\Output\QRMarkupHTML`
-- `\chillerlan\QRCode\Output\QRMarkupSVG`
-- `\chillerlan\QRCode\Output\QRString`
-- [github.com/chillerlan/php-qrcode/issues/223](https://github.com/chillerlan/php-qrcode/issues/223)
-
-
 ## outputInterface
 
-The FQCN of the custom `QROutputInterface`
-
-if `QROptions::$outputType` is set to `QROutputInterface::CUSTOM` (default: `null`)
-
-**Deprecated:** 5.0.0 the nullable type will be removed in future versions
-and the default value will be set to `QRMarkupSVG::class`
+The FQCN of the `QROutputInterface` to use
 
 
 ## returnResource
@@ -175,7 +139,6 @@ Sets the image background color (if applicable)
 - `QRFpdf`: defaults to blank internally (white page)
 
 
-
 ## invertMatrix
 
 Whether to invert the matrix (reflectance reversal)
@@ -232,9 +195,18 @@ Specifies which module types to exclude when `QROptions::$drawCircularModules` i
 
 Whether to connect the paths for the several module types to avoid weird glitches when using gradients etc.
 
+This option is exclusive to output classes that use the module collector `QROutputAbstract::collectModules()`,
+which converts the `$M_TYPE` of all modules to `QRMatrix::M_DATA` and `QRMatrix::M_DATA_DARK` respectively.
+
+Module types that should not be added to the connected path can be excluded via `QROptions::$excludeFromConnect`.
+
+Currentty used in `QREps` and `QRMarkupSVG`.
+
 
 **See also:**
 
+- `\chillerlan\QRCode\Output\QROutputAbstract::collectModules()`
+- `\chillerlan\QRCode\QROptionsTrait::$excludeFromConnect`
 - [github.com/chillerlan/php-qrcode/issues/57](https://github.com/chillerlan/php-qrcode/issues/57)
 
 
@@ -243,6 +215,11 @@ Whether to connect the paths for the several module types to avoid weird glitche
 Specify which paths/patterns to exclude from connecting if `QROptions::$connectPaths` is set to `true`
 
 
+**See also:**
+
+- `\chillerlan\QRCode\QROptionsTrait::$connectPaths`
+
+
 ## moduleValues
 
 Module values map
@@ -467,48 +444,3 @@ Increase the contrast before reading
 
 note that applying contrast works different in GD and Imagick, so mileage may vary
 
-
-## imageBase64
-
-**Deprecated:** 5.0.0 use QROptions::$outputBase64 instead
-
-**See also:**
-
-- `       \chillerlan\QRCode\QROptions::$outputBase64`
-
-
-## jpegQuality
-
-**Deprecated:** 5.0.0 use QROptions::$quality instead
-
-**See also:**
-
-- `       \chillerlan\QRCode\QROptions::$quality`
-
-
-## pngCompression
-
-**Deprecated:** 5.0.0 use QROptions::$quality instead
-
-**See also:**
-
-- `       \chillerlan\QRCode\QROptions::$quality`
-
-
-## imageTransparencyBG
-
-**Deprecated:** 5.0.0 use QROptions::$transparencyColor instead
-
-**See also:**
-
-- `       \chillerlan\QRCode\QROptions::$transparencyColor`
-
-
-## imagickBG
-
-**Deprecated:** 5.0.0 use QROptions::$bgColor instead
-
-**See also:**
-
-- `       \chillerlan\QRCode\QROptions::$bgColor`
-

+ 3 - 2
docs/Usage/Overview.md

@@ -12,12 +12,13 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
   - numeric
   - alphanumeric
   - 8-bit binary
+    - [ECI support](https://en.wikipedia.org/wiki/Extended_Channel_Interpretation)
   - 13-bit double-byte:
     - kanji (Japanese, Shift-JIS)
     - hanzi (simplified Chinese, GB2312/GB18030) as [defined in GBT18284-2000](https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000)
 - Flexible, easily extensible output modules, built-in support for the following output formats:
-  - [GdImage](https://www.php.net/manual/book.image)
-  - [ImageMagick](https://www.php.net/manual/book.imagick)
+  - [GdImage](https://www.php.net/manual/book.image) (raster graphics: avif, bmp, gif, jpeg, png, webp)
+  - [ImageMagick](https://www.php.net/manual/book.imagick) ([multiple supported image formats](https://imagemagick.org/script/formats.php))
   - Markup types: SVG, HTML, etc.
   - String types: JSON, plain text, etc.
   - Encapsulated Postscript (EPS)