smiley 3 lat temu
rodzic
commit
e8ac9e02a4
4 zmienionych plików z 60 dodań i 29 usunięć
  1. 9 5
      README.md
  2. 21 13
      examples/svg.php
  3. 1 1
      src/Output/QRImage.php
  4. 29 10
      src/QRCode.php

+ 9 - 5
README.md

@@ -81,12 +81,16 @@ echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';
 Wait, what was that? Please again, slower! See [Advanced usage](https://github.com/chillerlan/php-qrcode/wiki/Advanced-usage) on the wiki.
 
 ### Framework Integration
-- Drupal [Google Authenticator Login `ga_login`](https://www.drupal.org/project/ga_login)
-- WordPress [`wp-two-factor-auth`](https://github.com/sjinks/wp-two-factor-auth)
-- WordPress [Simple 2FA `simple-2fa`](https://wordpress.org/plugins/simple-2fa/)
-- WoltLab Suite [two-step-verification](http://pluginstore.woltlab.com/file/3007-two-step-verification/)
-- [Cachet](https://github.com/CachetHQ/Cachet)
+- Drupal:
+  - [Google Authenticator Login `ga_login`](https://www.drupal.org/project/ga_login)
+- WordPress:
+  - [`wp-two-factor-auth`](https://github.com/sjinks/wp-two-factor-auth)
+  - [`simple-2fa`](https://wordpress.org/plugins/simple-2fa/)
+  - [`wordpress-seo`](https://github.com/Yoast/wordpress-seo)
+- WoltLab Suite
+  - [two-step-verification](http://pluginstore.woltlab.com/file/3007-two-step-verification/)
 - [Appwrite](https://github.com/appwrite/appwrite)
+- [Cachet](https://github.com/CachetHQ/Cachet)
 - [twill](https://github.com/area17/twill)
 - other uses: [dependents](https://github.com/chillerlan/php-qrcode/network/dependents) / [packages](https://github.com/chillerlan/php-qrcode/network/dependents?dependent_type=PACKAGE)
 

+ 21 - 13
examples/svg.php

@@ -1,9 +1,12 @@
 <?php
+
 /**
  * @created      21.12.2017
  * @author       Smiley <smiley@chillerlan.net>
  * @copyright    2017 Smiley
  * @license      MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
  */
 
 namespace chillerlan\QRCodeExamples;
@@ -11,6 +14,7 @@ namespace chillerlan\QRCodeExamples;
 use chillerlan\QRCode\{QRCode, QROptions};
 use chillerlan\QRCode\Data\QRMatrix;
 use chillerlan\QRCode\Common\EccLevel;
+use function gzencode, header;
 
 require_once __DIR__.'/../vendor/autoload.php';
 
@@ -18,25 +22,29 @@ $data = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
 $gzip = true;
 
 $options = new QROptions([
-	'version'                => 7,
-	'outputType'             => QRCode::OUTPUT_MARKUP_SVG,
-	'imageBase64'            => false,
-	'eccLevel'               => EccLevel::L,
-	'addQuietzone'           => true,
+	'version'             => 7,
+	'outputType'          => QRCode::OUTPUT_MARKUP_SVG,
+	'imageBase64'         => false,
+	'eccLevel'            => EccLevel::L,
+	'addQuietzone'        => true,
 	// if set to true, the light modules won't be rendered
-	'imageTransparent'       => false,
+	'imageTransparent'    => false,
 	// empty the default value to remove the fill* attributes from the <path> elements
-	'markupDark'             => '',
-	'markupLight'            => '',
+	'markupDark'          => '',
+	'markupLight'         => '',
 	// draw the modules as circles isntead of squares
 	'drawCircularModules' => true,
-	'circleRadius'           => 0.4,
+	'circleRadius'        => 0.4,
+	// connect paths
+	'svgConnectPaths'     => true,
 	// keep modules of thhese types as square
-	'keepAsSquare'        => [QRMatrix::M_FINDER|QRMatrix::IS_DARK, QRMatrix::M_FINDER_DOT, QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK],
-	// connect
-	'svgConnectPaths'        => true,
+	'keepAsSquare'        => [
+		QRMatrix::M_FINDER|QRMatrix::IS_DARK,
+		QRMatrix::M_FINDER_DOT,
+		QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK,
+	],
 	// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
-	'svgDefs'                => '
+	'svgDefs'             => '
 	<linearGradient id="rainbow" x1="100%" y2="100%">
 		<stop stop-color="#e2453c" offset="2.5%"/>
 		<stop stop-color="#e07e39" offset="21.5%"/>

+ 1 - 1
src/Output/QRImage.php

@@ -11,7 +11,7 @@
 namespace chillerlan\QRCode\Output;
 
 /**
- * @deprecated backward compatibility, use QRGdImage instead
+ * @deprecated 5.0.0 backward compatibility, use QRGdImage instead
  * @see \chillerlan\QRCode\Output\QRGdImage
  */
 class QRImage extends QRGdImage{

+ 29 - 10
src/QRCode.php

@@ -34,16 +34,31 @@ class QRCode{
 	public const MASK_PATTERN_AUTO = -1;
 
 	/**
-	 * @deprecated backward compatibility
-	 * @see \chillerlan\QRCode\Common\EccLevel
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Common\EccLevel::L
+	 * @var int
 	 */
-	/** @var int */
 	public const ECC_L = EccLevel::L;
-	/** @var int */
+
+	/**
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Common\EccLevel::M
+	 * @var int
+	 */
 	public const ECC_M = EccLevel::M;
-	/** @var int */
+
+	/**
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Common\EccLevel::Q
+	 * @var int
+	 */
 	public const ECC_Q = EccLevel::Q;
-	/** @var int */
+
+	/**
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Common\EccLevel::H
+	 * @var int
+	 */
 	public const ECC_H = EccLevel::H;
 
 	/** @var string */
@@ -208,7 +223,8 @@ class QRCode{
 	/**
 	 * checks if a string qualifies as numeric (convenience method)
 	 *
-	 * @deprecated
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Data\Number::validateString()
 	 * @codeCoverageIgnore
 	 */
 	public function isNumber(string $string):bool{
@@ -218,7 +234,8 @@ class QRCode{
 	/**
 	 * checks if a string qualifies as alphanumeric (convenience method)
 	 *
-	 * @deprecated
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Data\AlphaNum::validateString()
 	 * @codeCoverageIgnore
 	 */
 	public function isAlphaNum(string $string):bool{
@@ -228,7 +245,8 @@ class QRCode{
 	/**
 	 * checks if a string qualifies as Kanji (convenience method)
 	 *
-	 * @deprecated
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Data\Kanji::validateString()
 	 * @codeCoverageIgnore
 	 */
 	public function isKanji(string $string):bool{
@@ -238,7 +256,8 @@ class QRCode{
 	/**
 	 * a dummy (convenience method)
 	 *
-	 * @deprecated
+	 * @deprecated 5.0.0
+	 * @see \chillerlan\QRCode\Data\Byte::validateString()
 	 * @codeCoverageIgnore
 	 */
 	public function isByte(string $string):bool{