Releases: miskith/QRInvoice
Releases · miskith/QRInvoice
Release list
4.0.1
4.0.0
Added
- QR Code Reader & Parser (
QRInvoice::fromString()):- Full support for parsing Czech QR Platba (
SPD*...), QR Faktura (SID*...), combined formats (SPD+X-INV), and SEPA EPC QR codes (BCD\n002...). - Added
verifyCRC32()method to validate checksum integrity of parsed strings. - Comprehensive getters for all extracted data.
- Full support for parsing Czech QR Platba (
- SEPA EPC QR Code standard (
EPC069-12):- Added
Standard::Epcsupport for Eurozone payments. - Added factory method
QRInvoice::createEpc(...). - Added support for BIC/SWIFT (
setBic), SEPA Purpose Code (setPurpose), and ISO 11649 Remittance Reference (setRemittanceReference).
- Added
- Pure SVG string output (
getSvg()):- Added
getSvg()method returning raw vector SVG markup for direct inline HTML/Latte/Blade template embedding or file saving, with an option to omit XML declaration.
- Added
- Logo & Center Icon embedding:
- Added
setLogo()to embed custom images in the center of the QR code with auto-scaling and punchout background. - Added
withDefaultLogo()to instantly embed the official Czech Banking Association (ČBA) "QR Platba" badge with automatic error correction upgrade to Level High.
- Added
- Custom Branding & Colors:
- Added
setForegroundColor(),setBackgroundColor(), andsetColors(). - Support for HEX colors (
#4F46E5), RGB components, or EndroidColorInterface. - Added
setTransparentBackground()for transparent backgrounds.
- Added
- Slovak Bank Account & IBAN support:
- Added
setSlovakAccount()and factory methodQRInvoice::createSlovak(). - Automatic conversion of Slovak accounts to IBAN (
SK...).
- Added
- Account Number Validation (Modulo 11):
- Integrated weighted Modulo 11 validation according to ČNB (Czech) and NBS (Slovak) specifications (
validateCzechAccount(),validateSlovakAccount(),setValidateAccount()).
- Integrated weighted Modulo 11 validation according to ČNB (Czech) and NBS (Slovak) specifications (
- Extended SPAYD & Invoice Attributes:
- Alternative accounts (
setAlternativeAccounts(),addAlternativeAccount()). - Instant payment flag (
setInstantPayment(),createInstant()). - Direct notification channels (
setNotificationEmail(),setNotificationPhone(),clearNotification()). - Internal payment identifier (
setInternalId()), custom URL (setUrl()), and retry repeat period (setRepeat()). - Checksum CRC32 calculation and verification (
setCRC32(),getCRC32()).
- Alternative accounts (
- Factory Constructors:
QRInvoice::create(...)QRInvoice::createInstant(...)QRInvoice::createEpc(...)QRInvoice::createSlovak(...)QRInvoice::createTaxInvoice(...)
- Native Backed Enums:
- Added
Currency,Format,InvoiceDocumentType,PaymentType,Standard,TaxPerformance.
- Added
Changed / Deprecations
- PHP Requirement: Minimum PHP version raised to PHP 8.4+.
- String literals for enums deprecated: Passing plain string literals to
setPaymentType(),setCurrency(),setTaxPerformance(),setInvoiceDocumentType(), andsaveQRCodeImage()is deprecated in favor of backed enums (backward compatibility preserved). - Composer schema: Removed
versionfield fromcomposer.jsonin accordance with Packagist guidelines.
Performance
- Single-pass diacritics stripping (
stripDiacritics): Replaced 40+ sequentialstr_replacepasses with a single-passstrtrusing a compile-time lookup table, eliminating dynamic memory allocations. - Direct ASCII IBAN arithmetic (
accountToIban): Replaced dynamic array generation (range()) and string replacement with direct ASCII arithmetic(ord(...) - 55)for country codes. - Zero-allocation Modulo 11 validation: Pre-allocated class constants for weights eliminating runtime array allocations and slicing.
Quality Assurance & Tooling
- PHPStan: Static analysis configured and passing at Level Max (Level 10) with
phpstan-strict-rulesandphpstan-phpunit(0 errors). - Rector: Configured with prepared code modernization sets.
- CI / CD: GitHub Actions workflows updated to
actions/checkout@v7and tested on PHP 8.4 and PHP 8.5. Configured Dependabot for Composer and GitHub Actions.