Constants

LABEL_FONT_PATH_DEFAULT

LABEL_FONT_PATH_DEFAULT = __DIR__ . '/../assets/noto_sans.otf'

Properties

$text

$text : string

Type

string

$size

$size : int

Type

int

$margin

$margin : int

Type

int

$foregroundColor

$foregroundColor : array

Type

array

$backgroundColor

$backgroundColor : array

Type

array

$encoding

$encoding : string

Type

string

$errorCorrectionLevel

$errorCorrectionLevel : \Endroid\QrCode\ErrorCorrectionLevel

Type

ErrorCorrectionLevel

$logoPath

$logoPath : string

Type

string

$logoWidth

$logoWidth : int

Type

int

$label

$label : string

Type

string

$labelFontSize

$labelFontSize : int

Type

int

$labelFontPath

$labelFontPath : string

Type

string

$labelAlignment

$labelAlignment : \Endroid\QrCode\LabelAlignment

Type

LabelAlignment

$labelMargin

$labelMargin : array

Type

array

$writer

$writer : \Endroid\QrCode\Writer\WriterInterface

Type

WriterInterface

$validateResult

$validateResult : bool

Type

bool

Methods

__construct()

__construct(string  $text = '') : mixed

Parameters

string $text

Returns

mixed —

setText()

setText(string  $text) : $this

Parameters

string $text

Returns

$this —

getText()

getText() : string

Returns

string —

setSize()

setSize(int  $size) : $this

Parameters

int $size

Returns

$this —

getSize()

getSize() : int

Returns

int —

setMargin()

setMargin(int  $margin) : $this

Parameters

int $margin

Returns

$this —

getMargin()

getMargin() : int

Returns

int —

setForegroundColor()

setForegroundColor(array  $foregroundColor) : $this

Parameters

array $foregroundColor

Returns

$this —

getForegroundColor()

getForegroundColor() : int[]

Returns

int[] —

setBackgroundColor()

setBackgroundColor(array  $backgroundColor) : $this

Parameters

array $backgroundColor

Returns

$this —

getBackgroundColor()

getBackgroundColor() : int[]

Returns

int[] —

setEncoding()

setEncoding(string  $encoding) : $this

Parameters

string $encoding

Returns

$this —

getEncoding()

getEncoding() : string

Returns

string —

setErrorCorrectionLevel()

setErrorCorrectionLevel(string  $errorCorrectionLevel) : $this

Parameters

string $errorCorrectionLevel

Returns

$this —

getErrorCorrectionLevel()

getErrorCorrectionLevel() : string

Returns

string —

setLogoPath()

setLogoPath(string  $logoPath) : $this

Parameters

string $logoPath

Throws

\Endroid\QrCode\Exception\InvalidPathException

Returns

$this —

getLogoPath()

getLogoPath() : string

Returns

string —

setLogoWidth()

setLogoWidth(int  $logoWidth) : $this

Parameters

int $logoWidth

Returns

$this —

getLogoWidth()

getLogoWidth() : int

Returns

int —

setLabel()

setLabel(string  $label, int  $labelFontSize = null, string  $labelFontPath = null, string  $labelAlignment = null, array  $labelMargin = null) : $this

Parameters

string $label
int $labelFontSize
string $labelFontPath
string $labelAlignment
array $labelMargin

Returns

$this —

getLabel()

getLabel() : string

Returns

string —

setLabelFontSize()

setLabelFontSize(int  $labelFontSize) : $this

Parameters

int $labelFontSize

Returns

$this —

getLabelFontSize()

getLabelFontSize() : int

Returns

int —

setLabelFontPath()

setLabelFontPath(string  $labelFontPath) : $this

Parameters

string $labelFontPath

Throws

\Endroid\QrCode\Exception\InvalidPathException

Returns

$this —

getLabelFontPath()

getLabelFontPath() : string

Returns

string —

setLabelAlignment()

setLabelAlignment(string  $labelAlignment) : $this

Parameters

string $labelAlignment

Returns

$this —

getLabelAlignment()

getLabelAlignment() : string

Returns

string —

setLabelMargin()

setLabelMargin(int[]  $labelMargin) : $this

Parameters

int[] $labelMargin

Returns

$this —

getLabelMargin()

getLabelMargin() : int[]

Returns

int[] —

setWriterRegistry()

setWriterRegistry(\Endroid\QrCode\WriterRegistryInterface  $writerRegistry) : $this

Parameters

\Endroid\QrCode\WriterRegistryInterface $writerRegistry

Returns

$this —

setWriter()

setWriter(\Endroid\QrCode\Writer\WriterInterface  $writer) : $this

Parameters

\Endroid\QrCode\Writer\WriterInterface $writer

Returns

$this —

getWriter()

getWriter(\Endroid\QrCode\Writer\WriterInterface  $name = null) : \Endroid\QrCode\Writer\WriterInterface

Parameters

\Endroid\QrCode\Writer\WriterInterface $name

Returns

\Endroid\QrCode\Writer\WriterInterface —

setWriterByName()

setWriterByName(string  $name) : $this

Parameters

string $name

Throws

\Endroid\QrCode\Exception\InvalidWriterException

Returns

$this —

setWriterByPath()

setWriterByPath(string  $path) : $this

Parameters

string $path

Returns

$this —

setWriterByExtension()

setWriterByExtension(string  $extension) : $this

Parameters

string $extension

Throws

\Endroid\QrCode\Exception\UnsupportedExtensionException

Returns

$this —

setValidateResult()

setValidateResult(bool  $validateResult) : $this

Parameters

bool $validateResult

Returns

$this —

getValidateResult()

getValidateResult() : bool

Returns

bool —

writeString()

writeString() : string

Returns

string —

writeDataUri()

writeDataUri() : string

Returns

string —

writeFile()

writeFile(string  $path) : mixed

Parameters

string $path

Returns

mixed —

getContentType()

getContentType() : string

Throws

\Endroid\QrCode\Exception\InvalidWriterException

Returns

string —