فهرست منبع

:octocat: added docblocks

smiley 8 سال پیش
والد
کامیت
fd3b73ec68
5فایلهای تغییر یافته به همراه159 افزوده شده و 10 حذف شده
  1. 59 2
      src/Output/QRImageOptions.php
  2. 48 2
      src/Output/QRMarkupOptions.php
  3. 21 2
      src/Output/QROutputOptionsAbstract.php
  4. 19 3
      src/Output/QRStringOptions.php
  5. 12 1
      src/QROptions.php

+ 59 - 2
src/Output/QRImageOptions.php

@@ -15,29 +15,86 @@ namespace chillerlan\QRCode\Output;
 use chillerlan\QRCode\QRCode;
 
 /**
- *
+ * @property bool $base64
+ * @property int  $pixelSize
+ * @property int  $marginSize
+ * @property bool $transparent
+ * @property int  $fgRed
+ * @property int  $fgGreen
+ * @property int  $fgBlue
+ * @property int  $bgRed
+ * @property int  $bgGreen
+ * @property int  $bgBlue
+ * @property int  $pngCompression
+ * @property int  $jpegQuality
  */
 class QRImageOptions extends QROutputOptionsAbstract{
 
+	/**
+	 * @var string
+	 */
 	protected $type = QRCode::OUTPUT_IMAGE_PNG;
 
+	/**
+	 * @var bool
+	 */
 	protected $base64 = true;
 
+	/**
+	 * @var int
+	 */
 	protected $pixelSize = 5;
+
+	/**
+	 * @var int
+	 */
 	protected $marginSize = 5;
 
-	// not supported by jpg
+	/**
+	 * not supported by jpg
+	 *
+	 * @var bool
+	 */
 	protected $transparent = true;
 
+	/**
+	 * @var int
+	 */
 	protected $fgRed   = 0;
+
+	/**
+	 * @var int
+	 */
 	protected $fgGreen = 0;
+
+	/**
+	 * @var int
+	 */
 	protected $fgBlue  = 0;
 
+	/**
+	 * @var int
+	 */
 	protected $bgRed   = 255;
+
+	/**
+	 * @var int
+	 */
 	protected $bgGreen = 255;
+
+	/**
+	 * @var int
+	 */
 	protected $bgBlue  = 255;
 
+	/**
+	 * @var int
+	 */
 	protected $pngCompression = -1;
+
+	/**
+	 * @var int
+	 */
 	protected $jpegQuality = 85;
 
 }

+ 48 - 2
src/Output/QRMarkupOptions.php

@@ -15,24 +15,70 @@ namespace chillerlan\QRCode\Output;
 use chillerlan\QRCode\QRCode;
 
 /**
- *
+ * @property string $htmlRowTag
+ * @property bool   $htmlOmitEndTag
+ * @property string $fgColor
+ * @property string $bgColor
+ * @property int    $pixelSize
+ * @property int    $marginSize
+ * @property string $cssClass
  */
 class QRMarkupOptions extends QROutputOptionsAbstract{
 
+	/**
+	 * QRCode::OUTPUT_MARKUP_XXXX where XXXX = HTML, SVG
+	 *
+	 * @var string
+	 */
 	protected $type = QRCode::OUTPUT_MARKUP_SVG;
 
+	/**
+	 * the shortest available semanically correct row (block) tag to not bloat the output
+	 *
+	 * @var string
+	 */
 	protected $htmlRowTag = 'p';
 
+	/**
+	 * the closing tag may be omitted (moar bloat!)
+	 *
+	 * @var bool
+	 */
 	protected $htmlOmitEndTag = true;
 
+	/**
+	 * foreground color
+	 *
+	 * @var string
+	 */
 	protected $fgColor = '#000';
 
+	/**
+	 * background color
+	 *
+	 * @var string
+	 */
 	protected $bgColor = '#fff';
 
+	/**
+	 * size of a QR code pixel
+	 *
+	 * @var int
+	 */
 	protected $pixelSize = 5;
 
+	/**
+	 * margin around the QR code
+	 *
+	 * @var int
+	 */
 	protected $marginSize = 5;
 
-	protected $cssClass = '';
+	/**
+	 * a common css class
+	 *
+	 * @var string
+	 */
+	protected $cssClass;
 
 }

+ 21 - 2
src/Output/QROutputOptionsAbstract.php

@@ -15,15 +15,34 @@ namespace chillerlan\QRCode\Output;
 use chillerlan\QRCode\Container;
 
 /**
- *
+ * @property string $type
+ * @property string $eol
+ * @property string $cachefile
  */
 abstract class QROutputOptionsAbstract{
 	use Container;
 
+	/**
+	 * Output type, determined by the used interface
+	 *
+	 * QRCode::OUTPUT_...
+	 *
+	 * @var string
+	 */
 	protected $type;
 
+	/**
+	 * newline string
+	 *
+	 * @var string
+	 */
 	protected $eol = PHP_EOL;
 
-	protected $cachefile = null;
+	/**
+	 * /path/to/cache.file
+	 *
+	 * @var string
+	 */
+	protected $cachefile;
 
 }

+ 19 - 3
src/Output/QRStringOptions.php

@@ -15,14 +15,30 @@ namespace chillerlan\QRCode\Output;
 use chillerlan\QRCode\QRCode;
 
 /**
- *
+ * @property string $textDark
+ * @property string $textLight
  */
 class QRStringOptions extends QROutputOptionsAbstract{
 
+	/**
+	 * QRCode::OUTPUT_STRING_XXXX where XXXX = TEXT, JSON
+	 *
+	 * @var string
+	 */
 	protected $type = QRCode::OUTPUT_STRING_JSON;
 
-	protected $textDark = '#';
+	/**
+	 * string substitute for dark
+	 *
+	 * @var string
+	 */
+	protected $textDark = '🔴';
 
-	protected $textLight = ' ';
+	/**
+	 * string substitute for light
+	 *
+	 * @var string
+	 */
+	protected $textLight = '⭕';
 
 }

+ 12 - 1
src/QROptions.php

@@ -13,17 +13,28 @@
 namespace chillerlan\QRCode;
 
 /**
- *
+ * @property int $errorCorrectLevel
+ * @property int $typeNumber
  */
 class QROptions{
 	use Container;
 
 	/**
+	 * Error correct level
+	 *
+	 *   QRCode::ERROR_CORRECT_LEVEL_X where X is
+	 *    L,   M,   Q,   H
+	 *   7%, 15%, 25%, 30%
+	 *
 	 * @var int
 	 */
 	protected $errorCorrectLevel = QRCode::ERROR_CORRECT_LEVEL_M;
 
 	/**
+	 * Type number
+	 *
+	 *   QRCode::TYPE_XX where XX is 01 ... 10, null = auto
+	 *
 	 * @var int
 	 */
 	protected $typeNumber = null;