chore: chillerlan/php-qrcode: from v4 to v5
#65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates https://github.com/chillerlan/php-qrcode/ to version 5.
It sets the default QR rendering options to the following:
These were the defaults in version 4, and they are now set explicitly to minimize the impact of this update.
Of course, users can still pass their own options to the render function:
Salla\ZATCA\GenerateQrCode::render. (Maybe this worth noting in the README?)Also, it might be better and safer to bump the major version of this package to reflect the dependency upgrade and potential changes introduced by updating chillerlan/php-qrcode to v5.
Related PRs: #63 , #46
You might want to take a look here:
The "options" changes: QRGdImage (custom): mime type is not properly set in base64 output chillerlan/php-qrcode#223
The GD+PNG+Transparency defaults: v5.0.0 release
Greptile Overview
Greptile Summary
Upgrades
chillerlan/php-qrcodefrom v4 to v5 and sets explicit rendering defaults (GD+PNG+transparency) to preserve v4 behavior and minimize breaking changes for existing users.outputTypedefault (QROutputInterface::GDIMAGE_PNG) to maintain GD+PNG output (v5 defaults to SVG)imageTransparentdefault (true) to maintain transparent backgrounds (v5 defaults to false)render()Key considerations:
shouldGenerateAQrCodeDisplayAsImageData) verifies PNG output format but doesn't test transparency or custom options scenariosConfidence Score: 3/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant User participant GenerateQrCode participant QROptions participant QRCode User->>GenerateQrCode: render(options, file) GenerateQrCode->>GenerateQrCode: Check if outputType/outputInterface not set alt outputType not set GenerateQrCode->>GenerateQrCode: Set outputType = GDIMAGE_PNG end GenerateQrCode->>GenerateQrCode: Check if imageTransparent not set alt imageTransparent not set GenerateQrCode->>GenerateQrCode: Set imageTransparent = true end GenerateQrCode->>QROptions: new QROptions(options) QROptions-->>GenerateQrCode: options object GenerateQrCode->>GenerateQrCode: toBase64() GenerateQrCode->>QRCode: new QRCode(options) GenerateQrCode->>QRCode: render(base64Data, file) QRCode-->>GenerateQrCode: rendered QR code GenerateQrCode-->>User: QR code stringContext used:
dashboard- All new code changes must include comprehensive automated tests, including unit, integration, and fu... (source)