\BaconQrCodeWriter

QR code writer.

Summary

Methods
Properties
Constants
__construct()
setRenderer()
getRenderer()
writeString()
writeFile()
No public properties found
No constants found
No protected methods found
$renderer
N/A
No private methods found
No private properties found
N/A

Properties

$renderer

$renderer : \BaconQrCode\Renderer\RendererInterface

Renderer instance.

Type

RendererInterface

Methods

__construct()

__construct(\BaconQrCode\Renderer\RendererInterface  $renderer) : mixed

Creates a new writer with a specific renderer.

Parameters

\BaconQrCode\Renderer\RendererInterface $renderer

Returns

mixed —

setRenderer()

setRenderer(\BaconQrCode\Renderer\RendererInterface  $renderer) : \BaconQrCode\Writer

Sets the renderer used to create a byte stream.

Parameters

\BaconQrCode\Renderer\RendererInterface $renderer

Returns

\BaconQrCode\Writer —

getRenderer()

getRenderer() : \BaconQrCode\Renderer\RendererInterface

Gets the renderer used to create a byte stream.

Returns

\BaconQrCode\Renderer\RendererInterface —

writeString()

writeString(string  $content, string  $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, int  $ecLevel = ErrorCorrectionLevel::L) : string

Writes QR code and returns it as string.

Content is a string which should be encoded in UTF-8, in case there are non ASCII-characters present.

Parameters

string $content
string $encoding
int $ecLevel

Throws

\BaconQrCode\Exception\InvalidArgumentException

Returns

string —

writeFile()

writeFile(string  $content, string  $filename, string  $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, int  $ecLevel = ErrorCorrectionLevel::L) : void

Writes QR code to a file.

Parameters

string $content
string $filename
string $encoding
int $ecLevel