# Documentation

Menu

## QRCode
in package

QRCode.php : 32

Turns a text string into a Model 2 QR Code

##### Tags

see
  https://github.com/kazuhikoarase/qrcode-generator/tree/master/php
see
  https://www.qrcode.com/en/codes/model12.html
see
  https://www.swisseduc.ch/informatik/theoretische_informatik/qr_codes/docs/qr_standard.pdf
see
  https://en.wikipedia.org/wiki/QR_code
see
  https://www.thonky.com/qr-code-tutorial/

### 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

QRCode.php : 44

A collection of one or more data segments of QRDataModeInterface instances to write

`protected array<string|int, QRDataModeInterface> $dataSegments = []`

#### $luminanceSourceFQN

QRCode.php : 49

The luminance source for the reader

`protected string $luminanceSourceFQN = \chillerlan\QRCode\Common\GDLuminanceSource::class`

#### $options

QRCode.php : 37

The settings container

`protected SettingsContainerInterface|QROptions $options`

### Methods

#### __construct()

QRCode.php : 56

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

phpstan-param

  array<string, mixed> $options

#### addAlphaNumSegment()

QRCode.php : 205

Adds an alphanumeric data segment

`public addAlphaNumSegment(string $data) : static`

ISO/IEC 18004:2000 8.3.3 - Alphanumeric Mode

##### Parameters

$data : string

##### Return values

static

#### addByteSegment()

QRCode.php : 232

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

static

#### addEciDesignator()

QRCode.php : 243

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

static

#### addEciSegment()

QRCode.php : 256

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

throws
  QRCodeException

##### Return values

static

#### addHanziSegment()

QRCode.php : 223

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

static

#### addKanjiSegment()

QRCode.php : 214

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

static

#### addNumericSegment()

QRCode.php : 196

Adds a numeric data segment

`public addNumericSegment(string $data) : static`

ISO/IEC 18004:2000 8.3.2 - Numeric Mode

##### Parameters

$data : string

##### Return values

static

#### addSegment()

QRCode.php : 174

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

static

#### clearSegments()

QRCode.php : 185

Clears the data segments array

`public clearSegments() : static`

##### Tags

codeCoverageIgnore

##### Return values

static

#### getQRMatrix()

QRCode.php : 109

Returns a QRMatrix object for the given $data and current QROptions

`public getQRMatrix() : QRMatrix`

##### Return values

QRMatrix

#### readFromBlob()

QRCode.php : 288

Reads a QR Code from the given data blob

`public readFromBlob(string $blob) : DecoderResult`

##### Parameters

$blob : string

##### Return values

DecoderResult

#### readFromFile()

QRCode.php : 281

Reads a QR Code from a given file

`public readFromFile(string $path) : DecoderResult`

##### Parameters

$path : string

##### Return values

DecoderResult

#### readFromSource()

QRCode.php : 295

Reads a QR Code from the given luminance source

`public readFromSource(LuminanceSourceInterface $source) : DecoderResult`

##### Parameters

$source : LuminanceSourceInterface

##### Return values

DecoderResult

#### render()

QRCode.php : 83

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()

QRCode.php : 102

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()

QRCode.php : 65

Sets an options instance

`public setOptions(SettingsContainerInterface|QROptions|iterable<string|int, mixed> $options) : static`

##### Parameters

$options : SettingsContainerInterface|QROptions|iterable<string|int, mixed>

##### Tags

phpstan-param

  array<string, mixed> $options

##### Return values

static

#### addMatrixModifications()

QRCode.php : 124

add matrix modifications after mask pattern evaluation and before handing over to output

`protected addMatrixModifications(QRMatrix $matrix) : QRMatrix`

##### Parameters

$matrix : QRMatrix

##### Return values

QRMatrix

#### initOutputInterface()

QRCode.php : 151

initializes a fresh built-in or custom QROutputInterface

`protected initOutputInterface(QRMatrix $matrix) : QROutputInterface`

##### Parameters

$matrix : QRMatrix

##### Tags

throws
  QRCodeOutputException

##### Return values

QROutputInterface

## Search results