\BaconQrCodeWriter

QR code writer.

Summary

Methods
Properties
Constants
__construct()
writeString()
writeFile()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$renderer
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 —

writeString()

writeString(string  $content, string  $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, ?\BaconQrCode\Common\ErrorCorrectionLevel  $ecLevel = null) : 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
?\BaconQrCode\Common\ErrorCorrectionLevel $ecLevel

Throws

\BaconQrCode\Exception\InvalidArgumentException

if the content is empty

Returns

string —

writeFile()

writeFile(string  $content, string  $filename, string  $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, ?\BaconQrCode\Common\ErrorCorrectionLevel  $ecLevel = null) : void

Writes QR code to a file.

Parameters

string $content
string $filename
string $encoding
?\BaconQrCode\Common\ErrorCorrectionLevel $ecLevel