QRMarkup
extends QROutputAbstract
in package
Converts the matrix into markup types: HTML, SVG, .
..
Table of Contents
- $length : int
- the side length of the QR image (modules * scale)
- $matrix : QRMatrix
- the (filled) data matrix object
- $moduleCount : int
- the current size of the QR matrix
- $moduleValues : array<string|int, mixed>
- an (optional) array of color values for the several QR matrix parts
- $options : SettingsContainerInterface
- $scale : int
- the current scaling for a QR pixel
- __construct() : mixed
- QROutputAbstract constructor.
- dump() : mixed
- base64encode() : string
- Returns a base64 data URI for the given string and mime type
- getDefaultModuleValue() : mixed
- Returns a defualt value for either dark or light modules (return value depends on the output module)
- getModuleValue() : mixed
- Returns the final value for the given input (return value depends on the output module)
- html() : string
- HTML output
- moduleValueIsValid() : bool
- Determines whether the given value is valid
- saveToFile() : void
- saves the qr data to a file
- setModuleValues() : void
- Sets the initial module values
- svg() : string
- SVG output
- svgHeader() : string
- returns the <svg> header with the given options parsed
- svgModule() : string
- returns a path segment for a single module
- svgPaths() : string
- returns one or more SVG <path> elements
Properties
$length
the side length of the QR image (modules * scale)
protected
int
$length
$matrix
the (filled) data matrix object
protected
QRMatrix
$matrix
$moduleCount
the current size of the QR matrix
protected
int
$moduleCount
Tags
$moduleValues
an (optional) array of color values for the several QR matrix parts
protected
array<string|int, mixed>
$moduleValues
$options
protected
SettingsContainerInterface
$options
$scale
the current scaling for a QR pixel
protected
int
$scale
Tags
Methods
__construct()
QROutputAbstract constructor.
public
__construct(SettingsContainerInterface $options, QRMatrix $matrix) : mixed
Parameters
- $options : SettingsContainerInterface
- $matrix : QRMatrix
Return values
mixed —dump()
public
dump([string $file = null ]) : mixed
Parameters
- $file : string = null
Tags
Return values
mixed —base64encode()
Returns a base64 data URI for the given string and mime type
protected
base64encode(string $data, string $mime) : string
Parameters
- $data : string
- $mime : string
Return values
string —getDefaultModuleValue()
Returns a defualt value for either dark or light modules (return value depends on the output module)
protected
getDefaultModuleValue(bool $isDark) : mixed
Parameters
- $isDark : bool
Tags
Return values
mixed —getModuleValue()
Returns the final value for the given input (return value depends on the output module)
protected
getModuleValue(mixed $value) : mixed
Parameters
- $value : mixed
Tags
Return values
mixed —html()
HTML output
protected
html(bool $saveToFile) : string
Parameters
- $saveToFile : bool
Return values
string —moduleValueIsValid()
Determines whether the given value is valid
protected
moduleValueIsValid(mixed $value) : bool
Parameters
- $value : mixed
Tags
Return values
bool —saveToFile()
saves the qr data to a file
protected
saveToFile(string $data, string $file) : void
Parameters
- $data : string
- $file : string
Tags
Return values
void —setModuleValues()
Sets the initial module values
protected
setModuleValues() : void
Return values
void —svg()
SVG output
protected
svg(bool $saveToFile) : string
Parameters
- $saveToFile : bool
Tags
Return values
string —svgHeader()
returns the <svg> header with the given options parsed
protected
svgHeader() : string
Return values
string —svgModule()
returns a path segment for a single module
protected
svgModule(int $x, int $y) : string
Parameters
- $x : int
- $y : int
Tags
Return values
string —svgPaths()
returns one or more SVG <path> elements
protected
svgPaths() : string