QRCode
in package
Turns a text string into a Model 2 QR Code
Tags
Table of Contents
Properties
- $dataSegments : array<string|int, QRDataModeInterface>
- A collection of one or more data segments of QRDataModeInterface instances to write
- $luminanceSourceFQN : string
- The luminance source for the reader
- $options : SettingsContainerInterface|QROptions
- The settings container
Methods
- __construct() : mixed
- QRCode constructor.
- addAlphaNumSegment() : static
- Adds an alphanumeric data segment
- addByteSegment() : static
- Adds an 8-bit byte data segment
- addEciDesignator() : static
- Adds a standalone ECI designator
- addEciSegment() : static
- Adds an ECI data segment (including designator)
- addHanziSegment() : static
- Adds a Hanzi data segment (simplified Chinese 13-bit double-byte characters, GB2312/GB18030)
- addKanjiSegment() : static
- Adds a Kanji data segment (Japanese 13-bit double-byte characters, Shift-JIS)
- addNumericSegment() : static
- Adds a numeric data segment
- addSegment() : static
- Adds a data segment
- clearSegments() : static
- Clears the data segments array
- getQRMatrix() : QRMatrix
- Returns a QRMatrix object for the given $data and current QROptions
- readFromBlob() : DecoderResult
- Reads a QR Code from the given data blob
- readFromFile() : DecoderResult
- Reads a QR Code from a given file
- readFromSource() : DecoderResult
- Reads a QR Code from the given luminance source
- render() : mixed
- Renders a QR Code for the given $data and QROptions, saves $file optionally
- renderMatrix() : mixed
- Renders a QR Code for the given QRMatrix and QROptions, saves $file optionally
- setOptions() : static
- Sets an options instance
- addMatrixModifications() : QRMatrix
- add matrix modifications after mask pattern evaluation and before handing over to output
- initOutputInterface() : QROutputInterface
- initializes a fresh built-in or custom QROutputInterface
Properties
$dataSegments
A collection of one or more data segments of QRDataModeInterface instances to write
protected
array<string|int, QRDataModeInterface>
$dataSegments
= []
$luminanceSourceFQN
The luminance source for the reader
protected
string
$luminanceSourceFQN
= \chillerlan\QRCode\Common\GDLuminanceSource::class
$options
The settings container
protected
SettingsContainerInterface|QROptions
$options
Methods
__construct()
QRCode constructor.
public
__construct([SettingsContainerInterface|QROptions|iterable<string|int, mixed> $options = new QROptions() ]) : mixed
Parameters
- $options : SettingsContainerInterface|QROptions|iterable<string|int, mixed> = new QROptions()
Tags
addAlphaNumSegment()
Adds an alphanumeric data segment
public
addAlphaNumSegment(string $data) : static
ISO/IEC 18004:2000 8.3.3 - Alphanumeric Mode
Parameters
- $data : string
Return values
staticaddByteSegment()
Adds an 8-bit byte data segment
public
addByteSegment(string $data) : static
ISO/IEC 18004:2000 8.3.4 - 8-bit Byte Mode
Parameters
- $data : string
Return values
staticaddEciDesignator()
Adds a standalone ECI designator
public
addEciDesignator(int $encoding) : static
The ECI designator must be followed by a Byte segment that contains the string encoded according to the given ECI charset
ISO/IEC 18004:2000 8.3.1 - Extended Channel Interpretation (ECI) Mode
Parameters
- $encoding : int
Return values
staticaddEciSegment()
Adds an ECI data segment (including designator)
public
addEciSegment(int $encoding, string $data) : static
The given string will be encoded from mb_internal_encoding() to the given ECI character set
I hate this somehow, but I'll leave it for now
Parameters
- $encoding : int
- $data : string
Tags
Return values
staticaddHanziSegment()
Adds a Hanzi data segment (simplified Chinese 13-bit double-byte characters, GB2312/GB18030)
public
addHanziSegment(string $data) : static
GBT18284-2000 Hanzi Mode
Parameters
- $data : string
Return values
staticaddKanjiSegment()
Adds a Kanji data segment (Japanese 13-bit double-byte characters, Shift-JIS)
public
addKanjiSegment(string $data) : static
ISO/IEC 18004:2000 8.3.5 - Kanji Mode
Parameters
- $data : string
Return values
staticaddNumericSegment()
Adds a numeric data segment
public
addNumericSegment(string $data) : static
ISO/IEC 18004:2000 8.3.2 - Numeric Mode
Parameters
- $data : string
Return values
staticaddSegment()
Adds a data segment
public
addSegment(QRDataModeInterface $segment) : static
ISO/IEC 18004:2000 8.3.6 - Mixing modes ISO/IEC 18004:2000 Annex H - Optimisation of bit stream length
Parameters
- $segment : QRDataModeInterface
Return values
staticclearSegments()
Clears the data segments array
public
clearSegments() : static
Tags
Return values
staticgetQRMatrix()
Returns a QRMatrix object for the given $data and current QROptions
public
getQRMatrix() : QRMatrix
Return values
QRMatrixreadFromBlob()
Reads a QR Code from the given data blob
public
readFromBlob(string $blob) : DecoderResult
Parameters
- $blob : string
Return values
DecoderResultreadFromFile()
Reads a QR Code from a given file
public
readFromFile(string $path) : DecoderResult
Parameters
- $path : string
Return values
DecoderResultreadFromSource()
Reads a QR Code from the given luminance source
public
readFromSource(LuminanceSourceInterface $source) : DecoderResult
Parameters
- $source : LuminanceSourceInterface
Return values
DecoderResultrender()
Renders a QR Code for the given $data and QROptions, saves $file optionally
public
render([string|null $data = null ][, string|null $file = null ]) : mixed
Parameters
- $data : string|null = null
- $file : string|null = null
renderMatrix()
Renders a QR Code for the given QRMatrix and QROptions, saves $file optionally
public
renderMatrix(QRMatrix $matrix[, string|null $file = null ]) : mixed
Parameters
- $matrix : QRMatrix
- $file : string|null = null
setOptions()
Sets an options instance
public
setOptions(SettingsContainerInterface|QROptions|iterable<string|int, mixed> $options) : static
Parameters
- $options : SettingsContainerInterface|QROptions|iterable<string|int, mixed>
Tags
Return values
staticaddMatrixModifications()
add matrix modifications after mask pattern evaluation and before handing over to output
protected
addMatrixModifications(QRMatrix $matrix) : QRMatrix
Parameters
- $matrix : QRMatrix
Return values
QRMatrixinitOutputInterface()
initializes a fresh built-in or custom QROutputInterface
protected
initOutputInterface(QRMatrix $matrix) : QROutputInterface
Parameters
- $matrix : QRMatrix