# Documentation

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 = -1
OUTPUT_CUSTOM = 'custom'
OUTPUT_EPS = 'eps'
OUTPUT_FPDF = 'fpdf'
OUTPUT_IMAGE_GIF = 'gif'
OUTPUT_IMAGE_JPG = 'jpg'
OUTPUT_IMAGE_PNG = 'png'
OUTPUT_IMAGICK = 'imagick'
OUTPUT_MARKUP_HTML = 'html'
OUTPUT_MARKUP_SVG = 'svg'
OUTPUT_MODES = [self::OUTPUT_MARKUP_SVG => \chillerlan\QRCode\Output\QRMarkupSVG::class, self::OUTPUT_MARKUP_HTML => \chillerlan\QRCode\Output\QRMarkupHTML::class, self::OUTPUT_IMAGE_PNG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_GIF => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_JPG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_STRING_JSON => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_STRING_TEXT => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_IMAGICK => \chillerlan\QRCode\Output\QRImagick::class, self::OUTPUT_FPDF => \chillerlan\QRCode\Output\QRFpdf::class, self::OUTPUT_EPS => \chillerlan\QRCode\Output\QREps::class]
  Map of built-in output modes => modules
OUTPUT_STRING_JSON = 'json'
OUTPUT_STRING_TEXT = 'text'
VERSION_AUTO = -1
$dataSegments : array<string|int, mixed>
  A collection of one or more data segments of [classname, data] to write
$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)
addKanjiSegment() : self
  Adds a Kanji data segment
addNumericSegment() : self
  Adds a numeric 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
addSegment() : void
  Adds a data segment
initCustomOutputInterface() : QROutputInterface
  initializes a custom output module after checking the existence of the class and if it implemnts the required interface
initOutputInterface() : QROutputInterface
  returns a fresh (built-in) QROutputInterface

### Constants

#### ECC_H

QRCode.php : 64
`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 : 43
`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 : 50
`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 : 57
`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 : 36
`public int MASK_PATTERN_AUTO = -1`

#### OUTPUT_CUSTOM

QRCode.php : 87
`public string OUTPUT_CUSTOM = 'custom'`

#### OUTPUT_EPS

QRCode.php : 85
`public string OUTPUT_EPS = 'eps'`

#### OUTPUT_FPDF

QRCode.php : 83
`public string OUTPUT_FPDF = 'fpdf'`

#### OUTPUT_IMAGE_GIF

QRCode.php : 75
`public string OUTPUT_IMAGE_GIF = 'gif'`

#### OUTPUT_IMAGE_JPG

QRCode.php : 73
`public string OUTPUT_IMAGE_JPG = 'jpg'`

#### OUTPUT_IMAGE_PNG

QRCode.php : 71
`public string OUTPUT_IMAGE_PNG = 'png'`

#### OUTPUT_IMAGICK

QRCode.php : 81
`public string OUTPUT_IMAGICK = 'imagick'`

#### OUTPUT_MARKUP_HTML

QRCode.php : 67
`public string OUTPUT_MARKUP_HTML = 'html'`

#### OUTPUT_MARKUP_SVG

QRCode.php : 69
`public string OUTPUT_MARKUP_SVG = 'svg'`

#### OUTPUT_MODES

QRCode.php : 94

Map of built-in output modes => modules

`public array<string|int, string> OUTPUT_MODES = [self::OUTPUT_MARKUP_SVG => \chillerlan\QRCode\Output\QRMarkupSVG::class, self::OUTPUT_MARKUP_HTML => \chillerlan\QRCode\Output\QRMarkupHTML::class, self::OUTPUT_IMAGE_PNG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_GIF => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_JPG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_STRING_JSON => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_STRING_TEXT => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_IMAGICK => \chillerlan\QRCode\Output\QRImagick::class, self::OUTPUT_FPDF => \chillerlan\QRCode\Output\QRFpdf::class, self::OUTPUT_EPS => \chillerlan\QRCode\Output\QREps::class]`

#### OUTPUT_STRING_JSON

QRCode.php : 77
`public string OUTPUT_STRING_JSON = 'json'`

#### OUTPUT_STRING_TEXT

QRCode.php : 79
`public string OUTPUT_STRING_TEXT = 'text'`

#### VERSION_AUTO

QRCode.php : 34
`public int VERSION_AUTO = -1`

### Properties

#### $dataSegments

QRCode.php : 121

A collection of one or more data segments of [classname, data] to write

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

##### Tags

see
  QRDataModeInterface

#### $options

QRCode.php : 112

The settings container

`protected SettingsContainerInterface $options`

### Methods

#### __construct()

QRCode.php : 128

QRCode constructor.

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

Sets the options instance

##### Parameters

$options : SettingsContainerInterface = null

##### Return values

mixed —

#### addAlphaNumSegment()

QRCode.php : 307

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 : 329

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 : 340

Adds a standalone ECI designator

`public addEciDesignator(int $encoding) : self`

ISO/IEC 18004:2000 8.3.1 - Extended Channel Interpretation (ECI) Mode

##### Parameters

$encoding : int

##### Return values

self —

#### addEciSegment()

QRCode.php : 353

Adds an ECI data segment (including designator)

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

i hate this somehow but i'll leave it for now

##### Parameters

$encoding : int
$data : string

##### Tags

throws
  QRCodeException

##### Return values

self —

#### addKanjiSegment()

QRCode.php : 318

Adds a Kanji data segment

`public addKanjiSegment(string $data) : self`

ISO/IEC 18004:2000 8.3.5 - Kanji Mode

##### Parameters

$data : string

##### Return values

self —

#### addNumericSegment()

QRCode.php : 296

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 —

#### clearSegments()

QRCode.php : 285

Clears the data segments array

`public clearSegments() : self`

##### Return values

self —

#### getMatrix()

QRCode.php : 159

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

`public getMatrix() : QRMatrix`

##### Tags

throws
  QRCodeDataException

##### Return values

QRMatrix —

#### isAlphaNum()

QRCode.php : 246

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 : 268

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 : 257

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 : 235

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 : 381

Reads a QR Code from the given data blob

`public readFromBlob(string $blob) : DecoderResult`

##### Parameters

$blob : string

##### Return values

DecoderResult —

#### readFromFile()

QRCode.php : 374

Reads a QR Code from a given file

`public readFromFile(string $path) : DecoderResult`

##### Parameters

$path : string

##### Return values

DecoderResult —

#### readFromSource()

QRCode.php : 388

Reads a QR Code from the given luminance source

`public readFromSource(LuminanceSourceInterface $source) : DecoderResult`

##### Parameters

$source : LuminanceSourceInterface

##### Return values

DecoderResult —

#### render()

QRCode.php : 137

Renders a QR Code for the given $data and QROptions

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

##### Parameters

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

##### Return values

mixed —

#### addSegment()

QRCode.php : 278

Adds a data segment

`protected addSegment(QRDataModeInterface $segment) : void`

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

void —

#### initCustomOutputInterface()

QRCode.php : 214

initializes a custom output module after checking the existence of the class and if it implemnts the required interface

`protected initCustomOutputInterface() : QROutputInterface`

##### Tags

throws
  QRCodeOutputException

##### Return values

QROutputInterface —

#### initOutputInterface()

QRCode.php : 194

returns a fresh (built-in) QROutputInterface

`protected initOutputInterface() : QROutputInterface`

##### Tags

throws
  QRCodeOutputException

##### Return values

QROutputInterface —

## Search results