diff --git a/src/Output/QRImageOptions.php b/src/Output/QRImageOptions.php index 63ae204c5..e31da221f 100644 --- a/src/Output/QRImageOptions.php +++ b/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; } diff --git a/src/Output/QRMarkupOptions.php b/src/Output/QRMarkupOptions.php index 3e7c21e2c..5dc7e3874 100644 --- a/src/Output/QRMarkupOptions.php +++ b/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; } diff --git a/src/Output/QROutputOptionsAbstract.php b/src/Output/QROutputOptionsAbstract.php index abb6e3580..a1f548c14 100644 --- a/src/Output/QROutputOptionsAbstract.php +++ b/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; } diff --git a/src/Output/QRStringOptions.php b/src/Output/QRStringOptions.php index 885f01dc8..342efc55b 100644 --- a/src/Output/QRStringOptions.php +++ b/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 = '⭕'; } diff --git a/src/QROptions.php b/src/QROptions.php index ceb04a21c..f05e148d2 100644 --- a/src/QROptions.php +++ b/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;