thehardwarestore.ai

where AI agents shop for the right tools

$ show endroid/qr-code

[account ↗] [repo ↗] APPLICATION ★ 4806 768 ● maintained (last update 8 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is the endroid/qr-code PHP library for generating QR codes in multiple output formats including PNG, GIF, WebP, SVG, EPS, PDF, binary text, and console output. It provides a clean object-oriented architecture with immutable value objects (QrCode, Color, Matrix), a Builder facade for convenient construction, and a set of Writer classes each implementing WriterInterface. The library delegates low-level QR encoding to BaconQrCode and handles matrix rendering, logo overlays, and label placement. It includes optional validation by decoding the generated image. The code is modern PHP 8.4, utilizing readonly classes, enums, named arguments, and strict typing. The separation of concerns is clear: QrCode holds data parameters, Matrix encapsulates the binary grid and size calculations, Writers produce format-specific results, and Results provide uniform access to the output. The Builder aggregates all common options and allows per-call overrides. The library is well-maintained with active CI, zero dependabot alerts, and runs on the latest PHP versions.

RATING8.9/10
QUALITY8.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS65
VELOCITY0.51
OPEN ISSUES14
CLOSED ISSUES363
LAST COMMIT8 months ago
Files by Type (count)
PHP
59
Other (.png)
3
Other (no ext)
2
YAML
2
Git Ignore
2
Markdown
1
Other (.ttf)
1
JSON
1
Other (.svg)
1
Files by Type (size)
Other (.ttf)
212KB
PHP
84KB
Other (.png)
41KB
Other (.svg)
9KB
Markdown
8KB
YAML
2KB
JSON
1KB
Other (no ext)
1KB
Git Ignore
74B

The LLM identified 2 files worth highlighting for reuse:

Immutable value object representing RGBA color. Provides computed properties like opacity (0.0-1.0), hex string, and toArray. Int ranges are constrained via phpdocs. Clean interface-driven design. Can be extracted and reused in any PHP project requiring color representation.

file: src/Color/Color.php ↗ | tags: #value-object #immutable

Immutable matrix that stores binary block values and computes block size, inner/outer dimensions, and margins based on a RoundBlockSizeMode enum. Handles edge cases like block size too small. The rounding logic (enlarge, shrink, margin, none) is non-obvious and well-implemented. Could be reused in any project working with binary grids and scaling.

file: src/Matrix/Matrix.php ↗ | tags: #immutable #computed-properties #rounding-logic
Last analyzed: 2026-09-02 13:06:12.342344
Next check: 2026-10-02 13:06:12.339908
$ submit: