Menu

## QRCode
in package

QRCode.php : 31

Turns a text string into a Model 2 QR Code

##### Tags

see
  https://github.com/kazuhikoarase/qrcode-generator/tree/master/php
see
  http://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
  http://www.thonky.com/qr-code-tutorial/

### Table of Contents

ECC_H = \chillerlan\QRCode\Common\EccLevel::H
ECC_L = \chillerlan\QRCode\Common\EccLevel::L
ECC_M = \chillerlan\QRCode\Common\EccLevel::M
ECC_Q = \chillerlan\QRCode\Common\EccLevel::Q
MASK_PATTERN_AUTO = \chillerlan\QRCode\Common\MaskPattern::AUTO
OUTPUT_CUSTOM = \chillerlan\QRCode\Output\QROutputInterface::CUSTOM
OUTPUT_EPS = \chillerlan\QRCode\Output\QROutputInterface::EPS
OUTPUT_FPDF = \chillerlan\QRCode\Output\QROutputInterface::FPDF
OUTPUT_IMAGE_GIF = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_GIF
OUTPUT_IMAGE_JPG = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_JPG
OUTPUT_IMAGE_PNG = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_PNG
OUTPUT_IMAGICK = \chillerlan\QRCode\Output\QROutputInterface::IMAGICK
OUTPUT_MARKUP_HTML = \chillerlan\QRCode\Output\QROutputInterface::MARKUP_HTML
OUTPUT_MARKUP_SVG = \chillerlan\QRCode\Output\QROutputInterface::MARKUP_SVG
OUTPUT_MODES = \chillerlan\QRCode\Output\QROutputInterface::MODES
OUTPUT_STRING_JSON = \chillerlan\QRCode\Output\QROutputInterface::STRING_JSON
OUTPUT_STRING_TEXT = \chillerlan\QRCode\Output\QROutputInterface::STRING_TEXT
VERSION_AUTO = \chillerlan\QRCode\Common\Version::AUTO
$dataSegments : array<string|int, mixed>
  A collection of one or more data segments of QRDataModeInterface instances to write
$luminanceSourceFQN : string
  The luminance source for the reader
$options : SettingsContainerInterface
  The settings container
__construct() : mixed
  QRCode constructor.
addAlphaNumSegment() : self
  Adds an alphanumeric data segment
addByteSegment() : self
  Adds an 8-bit byte data segment
addEciDesignator() : self
  Adds a standalone ECI designator
addEciSegment() : self
  Adds an ECI data segment (including designator)
addHanziSegment() : self
  Adds a Hanzi data segment (simplified Chinese 13-bit double-byte characters, GB2312/GB18030)
addKanjiSegment() : self
  Adds a Kanji data segment (Japanese 13-bit double-byte characters, Shift-JIS)
addNumericSegment() : self
  Adds a numeric data segment
addSegment() : self
  Adds a data segment
clearSegments() : self
  Clears the data segments array
getMatrix() : QRMatrix
  Returns a QRMatrix object for the given $data and current QROptions
isAlphaNum() : bool
  checks if a string qualifies as alphanumeric (convenience method)
isByte() : bool
  a dummy (convenience method)
isKanji() : bool
  checks if a string qualifies as Kanji (convenience method)
isNumber() : bool
  checks if a string qualifies as numeric (convenience method)
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() : self
  Sets an options instance
initOutputInterface() : QROutputInterface
  initializes a fresh built-in or custom QROutputInterface

### Constants

#### ECC_H

QRCode.php : 73
`public int ECC_H = \chillerlan\QRCode\Common\EccLevel::H`

##### Tags

deprecated
  5.0.0

  use EccLevel::H instead

see
  EccLevel::H

#### ECC_L

QRCode.php : 52
`public int ECC_L = \chillerlan\QRCode\Common\EccLevel::L`

##### Tags

deprecated
  5.0.0

  use EccLevel::L instead

see
  EccLevel::L

#### ECC_M

QRCode.php : 59
`public int ECC_M = \chillerlan\QRCode\Common\EccLevel::M`

##### Tags

deprecated
  5.0.0

  use EccLevel::M instead

see
  EccLevel::M

#### ECC_Q

QRCode.php : 66
`public int ECC_Q = \chillerlan\QRCode\Common\EccLevel::Q`

##### Tags

deprecated
  5.0.0

  use EccLevel::Q instead

see
  EccLevel::Q

#### MASK_PATTERN_AUTO

QRCode.php : 45
`public int MASK_PATTERN_AUTO = \chillerlan\QRCode\Common\MaskPattern::AUTO`

##### Tags

deprecated
  5.0.0

  use MaskPattern::AUTO instead

see
  MaskPattern::AUTO

#### OUTPUT_CUSTOM

QRCode.php : 150
`public string OUTPUT_CUSTOM = \chillerlan\QRCode\Output\QROutputInterface::CUSTOM`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::CUSTOM instead

see
  QROutputInterface::CUSTOM

#### OUTPUT_EPS

QRCode.php : 143
`public string OUTPUT_EPS = \chillerlan\QRCode\Output\QROutputInterface::EPS`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::EPS instead

see
  QROutputInterface::EPS

#### OUTPUT_FPDF

QRCode.php : 136
`public string OUTPUT_FPDF = \chillerlan\QRCode\Output\QROutputInterface::FPDF`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::FPDF instead

see
  QROutputInterface::FPDF

#### OUTPUT_IMAGE_GIF

QRCode.php : 108
`public string OUTPUT_IMAGE_GIF = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_GIF`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::GDIMAGE_GIF instead

see
  QROutputInterface::GDIMAGE_GIF

#### OUTPUT_IMAGE_JPG

QRCode.php : 101
`public string OUTPUT_IMAGE_JPG = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_JPG`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::GDIMAGE_JPG instead

see
  QROutputInterface::GDIMAGE_JPG

#### OUTPUT_IMAGE_PNG

QRCode.php : 94
`public string OUTPUT_IMAGE_PNG = \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_PNG`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::GDIMAGE_PNG instead

see
  QROutputInterface::GDIMAGE_PNG

#### OUTPUT_IMAGICK

QRCode.php : 129
`public string OUTPUT_IMAGICK = \chillerlan\QRCode\Output\QROutputInterface::IMAGICK`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::IMAGICK instead

see
  QROutputInterface::IMAGICK

#### OUTPUT_MARKUP_HTML

QRCode.php : 80
`public string OUTPUT_MARKUP_HTML = \chillerlan\QRCode\Output\QROutputInterface::MARKUP_HTML`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::MARKUP_HTML instead

see
  QROutputInterface::MARKUP_HTML

#### OUTPUT_MARKUP_SVG

QRCode.php : 87
`public string OUTPUT_MARKUP_SVG = \chillerlan\QRCode\Output\QROutputInterface::MARKUP_SVG`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::MARKUP_SVG instead

see
  QROutputInterface::MARKUP_SVG

#### OUTPUT_MODES

QRCode.php : 157
`public array<string|int, string> OUTPUT_MODES = \chillerlan\QRCode\Output\QROutputInterface::MODES`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::MODES instead

see
  QROutputInterface::MODES

#### OUTPUT_STRING_JSON

QRCode.php : 115
`public string OUTPUT_STRING_JSON = \chillerlan\QRCode\Output\QROutputInterface::STRING_JSON`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::STRING_JSON instead

see
  QROutputInterface::STRING_JSON

#### OUTPUT_STRING_TEXT

QRCode.php : 122
`public string OUTPUT_STRING_TEXT = \chillerlan\QRCode\Output\QROutputInterface::STRING_TEXT`

##### Tags

deprecated
  5.0.0

  use QROutputInterface::STRING_TEXT instead

see
  QROutputInterface::STRING_TEXT

#### VERSION_AUTO

QRCode.php : 38
`public int VERSION_AUTO = \chillerlan\QRCode\Common\Version::AUTO`

##### Tags

deprecated
  5.0.0

  use Version::AUTO instead

see
  Version::AUTO

### Properties

#### $dataSegments

QRCode.php : 171

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

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

#### $luminanceSourceFQN

QRCode.php : 176

The luminance source for the reader

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

#### $options

QRCode.php : 164

The settings container

`protected SettingsContainerInterface $options`

### Methods

#### __construct()

QRCode.php : 181

QRCode constructor.

`public __construct([SettingsContainerInterface $options = null ]) : mixed`

##### Parameters

$options : SettingsContainerInterface = null

##### Return values

mixed —

#### addAlphaNumSegment()

QRCode.php : 372

Adds an alphanumeric data segment

`public addAlphaNumSegment(string $data) : self`

ISO/IEC 18004:2000 8.3.3 - Alphanumeric Mode

##### Parameters

$data : string

##### Return values

self —

#### addByteSegment()

QRCode.php : 399

Adds an 8-bit byte data segment

`public addByteSegment(string $data) : self`

ISO/IEC 18004:2000 8.3.4 - 8-bit Byte Mode

##### Parameters

$data : string

##### Return values

self —

#### addEciDesignator()

QRCode.php : 410

Adds a standalone ECI designator

`public addEciDesignator(int $encoding) : self`

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

self —

#### addEciSegment()

QRCode.php : 423

Adds an ECI data segment (including designator)

`public addEciSegment(int $encoding, string $data) : self`

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

self —

#### addHanziSegment()

QRCode.php : 390

Adds a Hanzi data segment (simplified Chinese 13-bit double-byte characters, GB2312/GB18030)

`public addHanziSegment(string $data) : self`

GBT18284-2000 Hanzi Mode

##### Parameters

$data : string

##### Return values

self —

#### addKanjiSegment()

QRCode.php : 381

Adds a Kanji data segment (Japanese 13-bit double-byte characters, Shift-JIS)

`public addKanjiSegment(string $data) : self`

ISO/IEC 18004:2000 8.3.5 - Kanji Mode

##### Parameters

$data : string

##### Return values

self —

#### addNumericSegment()

QRCode.php : 363

Adds a numeric data segment

`public addNumericSegment(string $data) : self`

ISO/IEC 18004:2000 8.3.2 - Numeric Mode

##### Parameters

$data : string

##### Return values

self —

#### addSegment()

QRCode.php : 341

Adds a data segment

`public addSegment(QRDataModeInterface $segment) : self`

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

self —

#### clearSegments()

QRCode.php : 352

Clears the data segments array

`public clearSegments() : self`

##### Tags

codeCoverageIgnore

##### Return values

self —

#### getMatrix()

QRCode.php : 234

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

`public getMatrix() : QRMatrix`

##### Tags

throws
  QRCodeDataException

##### Return values

QRMatrix —

#### isAlphaNum()

QRCode.php : 309

checks if a string qualifies as alphanumeric (convenience method)

`public isAlphaNum(string $string) : bool`

##### Parameters

$string : string

##### Tags

deprecated
  5.0.0

  use AlphaNum::validateString() instead

see
  AlphaNum::validateString()
codeCoverageIgnore

##### Return values

bool —

#### isByte()

QRCode.php : 331

a dummy (convenience method)

`public isByte(string $string) : bool`

##### Parameters

$string : string

##### Tags

deprecated
  5.0.0

  use Byte::validateString() instead

see
  Byte::validateString()
codeCoverageIgnore

##### Return values

bool —

#### isKanji()

QRCode.php : 320

checks if a string qualifies as Kanji (convenience method)

`public isKanji(string $string) : bool`

##### Parameters

$string : string

##### Tags

deprecated
  5.0.0

  use Kanji::validateString() instead

see
  Kanji::validateString()
codeCoverageIgnore

##### Return values

bool —

#### isNumber()

QRCode.php : 298

checks if a string qualifies as numeric (convenience method)

`public isNumber(string $string) : bool`

##### Parameters

$string : string

##### Tags

deprecated
  5.0.0

  use Number::validateString() instead

see
  Number::validateString()
codeCoverageIgnore

##### Return values

bool —

#### readFromBlob()

QRCode.php : 455

Reads a QR Code from the given data blob

`public readFromBlob(string $blob) : DecoderResult`

@noinspection PhpUndefinedMethodInspection

##### Parameters

$blob : string

##### Return values

DecoderResult —

#### readFromFile()

QRCode.php : 446

Reads a QR Code from a given file

`public readFromFile(string $path) : DecoderResult`

##### Parameters

$path : string

##### Tags

noinspection

  PhpUndefinedMethodInspection

##### Return values

DecoderResult —

#### readFromSource()

QRCode.php : 462

Reads a QR Code from the given luminance source

`public readFromSource(LuminanceSourceInterface $source) : DecoderResult`

##### Parameters

$source : LuminanceSourceInterface

##### Return values

DecoderResult —

#### render()

QRCode.php : 203

Renders a QR Code for the given $data and QROptions, saves $file optionally

`public render([string $data = null ][, string $file = null ]) : mixed`

##### Parameters

$data : string = null
$file : string = null

##### Return values

mixed —

#### renderMatrix()

QRCode.php : 225

Renders a QR Code for the given QRMatrix and QROptions, saves $file optionally

`public renderMatrix(QRMatrix $matrix[, string $file = null ]) : mixed`

##### Parameters

$matrix : QRMatrix
$file : string = null

##### Return values

mixed —

#### setOptions()

QRCode.php : 188

Sets an options instance

`public setOptions(SettingsContainerInterface $options) : self`

##### Parameters

$options : SettingsContainerInterface

##### Return values

self —

#### initOutputInterface()

QRCode.php : 273

initializes a fresh built-in or custom QROutputInterface

`protected initOutputInterface(QRMatrix $matrix) : QROutputInterface`

##### Parameters

$matrix : QRMatrix

##### Tags

throws
  QRCodeOutputException

##### Return values

QROutputInterface —

## Search results