qr-code
qr-code copied to clipboard
Writer and Result classes for printing a QR-Code on a console
Hello,
I've created a new Writer for printing a QR Code on Command Line Interface. I find it very useful to get data or link from a server to your smartphone.
You can expect something like this for example :

(since it uses UTF-8, it should probably fail on Windows)
Usage
require_once __DIR__ . '/vendor/autoload.php';
use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Writer\ConsoleWriter;
$result = Builder::create()
->writer(new ConsoleWriter())
->data($argv[1])
->build();
echo $result->getString();
Hope this helps :cherry_blossom:
Sorry, took me a while to check with PHPStan
@Trismegiste sorry for the late response. I was enjoying my vacation ;) Really nice feature, great addition! Regarding the dark mode: I would really prefer to use the current QR code foreground and background color for this. If you could make it so that those colors are used we can create a dark mode using the current interface (and if really wanted, create a separate MR for creating a global dark mode setting).
Done :coffee:

@Trismegiste thank you. I have to fix some new QA issues I see (not caused by your changes) before I tag the new version but your feature is merged :)
Tag 4.5.0