cline/qr is a standalone QR code generation and decoding package. The
repository keeps the Cline project skeleton for tooling and maintenance
while the implementation and test coverage live directly in this package.
Requires PHP 8.4+
composer require cline/qruse Cline\Qr\Builder\Builder;
use Cline\Qr\Writer\PngWriter;
$result = new Builder(
data: 'Hello world',
)
->withWriter(new PngWriter())
->build();
file_put_contents('qr.png', $result->getString());Public immutable value objects also expose additive with* methods when
you want to derive a modified copy without going back through the builder:
use Cline\Qr\Color\Color;
use Cline\Qr\QrCode;
$qrCode = (new QrCode('Hello world'))
->withSize(512)
->withMargin(4)
->withForegroundColor(new Color(12, 34, 56));Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
The MIT License. Please see License File for more information.