Constants

LABEL_FONT_PATH_DEFAULT

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

ROUND_BLOCK_SIZE_MODE_MARGIN

ROUND_BLOCK_SIZE_MODE_MARGIN = 'margin'

ROUND_BLOCK_SIZE_MODE_SHRINK

ROUND_BLOCK_SIZE_MODE_SHRINK = 'shrink'

ROUND_BLOCK_SIZE_MODE_ENLARGE

ROUND_BLOCK_SIZE_MODE_ENLARGE = 'enlarge'

Properties

$text

$text

$size

$size : int

Type

int

$margin

$margin : int

Type

int

$foregroundColor

$foregroundColor : int[]

Type

int[]

$backgroundColor

$backgroundColor : int[]

Type

int[]

$encoding

$encoding : string

Type

string

$roundBlockSize

$roundBlockSize : bool

Type

bool

$roundBlockSizeMode

$roundBlockSizeMode : string

Type

string

$errorCorrectionLevel

$errorCorrectionLevel

$logoPath

$logoPath : string

Type

string

$logoWidth

$logoWidth : int|null

Type

int|null

$logoHeight

$logoHeight : int|null

Type

int|null

$label

$label : string

Type

string

$labelFontSize

$labelFontSize : int

Type

int

$labelFontPath

$labelFontPath : string

Type

string

$labelAlignment

$labelAlignment

$labelMargin

$labelMargin : array<string,int>

Type

array

$writerOptions

$writerOptions : array

Type

array

$validateResult

$validateResult : bool

Type

bool

Methods

__construct()

__construct(string  $text = '') : mixed

Parameters

string $text

Returns

mixed —

setText()

setText(string  $text) : void

Parameters

string $text

getText()

getText() : string

Returns

string —

setSize()

setSize(int  $size) : void

Parameters

int $size

getSize()

getSize() : int

Returns

int —

setMargin()

setMargin(int  $margin) : void

Parameters

int $margin

getMargin()

getMargin() : int

Returns

int —

setForegroundColor()

setForegroundColor(int[]  $foregroundColor) : void

Parameters

int[] $foregroundColor

getForegroundColor()

getForegroundColor() : int[]

Returns

int[] —

setBackgroundColor()

setBackgroundColor(int[]  $backgroundColor) : void

Parameters

int[] $backgroundColor

getBackgroundColor()

getBackgroundColor() : int[]

Returns

int[] —

setEncoding()

setEncoding(string  $encoding) : void

Parameters

string $encoding

getEncoding()

getEncoding() : string

Returns

string —

setRoundBlockSize()

setRoundBlockSize(bool  $roundBlockSize, string  $roundBlockSizeMode = self::ROUND_BLOCK_SIZE_MODE_MARGIN) : void

Parameters

bool $roundBlockSize
string $roundBlockSizeMode

getRoundBlockSize()

getRoundBlockSize() : bool

Returns

bool —

setRoundBlockSizeMode()

setRoundBlockSizeMode(string  $roundBlockSizeMode) : void

Parameters

string $roundBlockSizeMode

setErrorCorrectionLevel()

setErrorCorrectionLevel(\Endroid\QrCode\ErrorCorrectionLevel  $errorCorrectionLevel) : void

Parameters

\Endroid\QrCode\ErrorCorrectionLevel $errorCorrectionLevel

getErrorCorrectionLevel()

getErrorCorrectionLevel() : \Endroid\QrCode\ErrorCorrectionLevel

Returns

\Endroid\QrCode\ErrorCorrectionLevel —

setLogoPath()

setLogoPath(string  $logoPath) : void

Parameters

string $logoPath

getLogoPath()

getLogoPath() : ?string

Returns

?string —

setLogoSize()

setLogoSize(int  $logoWidth, int  $logoHeight = null) : void

Parameters

int $logoWidth
int $logoHeight

setLogoWidth()

setLogoWidth(int  $logoWidth) : void

Parameters

int $logoWidth

getLogoWidth()

getLogoWidth() : ?int

Returns

?int —

setLogoHeight()

setLogoHeight(int  $logoHeight) : void

Parameters

int $logoHeight

getLogoHeight()

getLogoHeight() : ?int

Returns

?int —

setLabel()

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

Parameters

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

getLabel()

getLabel() : ?string

Returns

?string —

setLabelFontSize()

setLabelFontSize(int  $labelFontSize) : void

Parameters

int $labelFontSize

getLabelFontSize()

getLabelFontSize() : int

Returns

int —

setLabelFontPath()

setLabelFontPath(string  $labelFontPath) : void

Parameters

string $labelFontPath

getLabelFontPath()

getLabelFontPath() : string

Returns

string —

setLabelAlignment()

setLabelAlignment(string  $labelAlignment) : void

Parameters

string $labelAlignment

getLabelAlignment()

getLabelAlignment() : string

Returns

string —

setLabelMargin()

setLabelMargin(array<string,int>  $labelMargin) : void

Parameters

array $labelMargin

getLabelMargin()

getLabelMargin() : int[]

Returns

int[] —

setWriterRegistry()

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

Parameters

\Endroid\QrCode\WriterRegistryInterface $writerRegistry

setWriter()

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

Parameters

\Endroid\QrCode\Writer\WriterInterface $writer

getWriter()

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

Parameters

string $name

Returns

\Endroid\QrCode\Writer\WriterInterface —

setWriterOptions()

setWriterOptions(array<string,mixed>  $writerOptions) : void

Parameters

array $writerOptions

getWriterOptions()

getWriterOptions() : array

Returns

array —

setWriterByName()

setWriterByName(string  $name) : void

Parameters

string $name

setWriterByPath()

setWriterByPath(string  $path) : void

Parameters

string $path

setWriterByExtension()

setWriterByExtension(string  $extension) : void

Parameters

string $extension

writeString()

writeString() : string

Returns

string —

writeDataUri()

writeDataUri() : string

Returns

string —

writeFile()

writeFile(string  $path) : void

Parameters

string $path

getContentType()

getContentType() : string

Returns

string —

setValidateResult()

setValidateResult(bool  $validateResult) : void

Parameters

bool $validateResult

getValidateResult()

getValidateResult() : bool

Returns

bool —

getData()

getData() : array

Returns

array —

createWriterRegistry()

createWriterRegistry() : void