Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QR-Code options method #250

Closed
wants to merge 3 commits into from
Closed

Conversation

sdespont
Copy link
Contributor

Details #249

@sdespont
Copy link
Contributor Author

sdespont commented May 14, 2024

@sprain, what's the point of automatically executing tests in the workflow if they can't succeed? This test only works in a hardened environment”. Does that help?

@kohlerdominik
Copy link
Contributor

I think the test fails because "prefer-lowest" will go for the lowest allowed endroid-version, which is 4.4.4, and this version does not have Endroid\QrCode\Writer\SvgWriter::WRITER_OPTION_COMPACT I guess?

The fix would be to remove endroid/qr-code: ^4.4.4 from composer.json. Is there reason to keep the compatibility?

@sdespont
Copy link
Contributor Author

I think we should drop EOL PHP 8.0 permitting to drop endroid/qr-code: ^4

@sprain ok for you ?

@@ -2,14 +2,14 @@

namespace Sprain\SwissQrBill\PaymentPart\Output\TcPdfOutput;

use Endroid\QrCode\Writer\SvgWriter;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not keen on exposing Endroid functionality outside of our own QrCode class. The goal was to keep all qr code functionality encased there.

I would prefer if we could add the additional option within QrCode, with a more specific method name – maybe as simple as $qrCode->optimizeForTcPdfOutput(), which then adds the required option.

@sprain
Copy link
Owner

sprain commented May 15, 2024

Thanks for the PR!

I think we should drop EOL PHP 8.0 permitting to drop endroid/qr-code: ^4

I remember the backlash when I dropped support for endroid/qr-code: ^3 too soon 😅

PHP 8.0 still counts for 20% of all installs of this library, and even 25% for v4 of this library.
In addition, endroid/qr-code: ^4 is still the most used version of that dependency by far, so dropping support might bring trouble for some projects.

Therefore, the way to go would be to add parallel support for both versions, before dropping the older one. We already do that in the constructor of QrCode.

@sdespont
Copy link
Contributor Author

ok, it means that Endroid\QrCode\Writer\SvgWriter::WRITER_OPTION_COMPACT cannot be used and we need to harcode the option key "compact" instead. I have pushed a commit for that

@sprain
Copy link
Owner

sprain commented May 15, 2024

ok, it means that Endroid\QrCode\Writer\SvgWriter::WRITER_OPTION_COMPACT cannot be used and we need to harcode the option key "compact" instead. I have pushed a commit for that

That's not what I meant :) This still couples TcPdfOuput directly to the Endroid library, which I want to avoid.

But I can take over from here, no worries.

@kohlerdominik
Copy link
Contributor

kohlerdominik commented May 15, 2024

@sprain Tests in prefer-stable & >8.1 are not only failing, but also taking >15Minutes compared to the <15Seconds that they used to take.

There seems to be a significant issue with one of the dependencies. So once the tests are fixed, please also keep an eye on the runtime.

@sprain
Copy link
Owner

sprain commented May 15, 2024

Replaced by #252

@sprain sprain closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants