khanamiryan / php-qrcode-detector-decoder

This is a PHP library to detect and decode QR-codes. This is first and only QR code reader that works without extensions.
Apache License 2.0
1.38k stars 324 forks source link

Merge various of the open PRs + Improve PHP 8.1+ compatibility #123

Closed GenieTim closed 2 years ago

GenieTim commented 2 years ago

Using mostly automated tools with some manual checks and corrections afterwards, this PR catapults this library to 2022 and PHP 8.1.

Most notable features:

  1. Require PHP 8.1
  2. Adds typehints (return types, argument types) where obviously applicable
  3. Fixes some issues in PHP 8.1, e.g. Implicit conversion from float ... to int loses precision
  4. Adds an opinionated default for code style/formatting
GenieTim commented 2 years ago

Thank you very much for merging this so fast! May I kindly ask you to publish it so I can install the update via composer? Thanks!

khanamiryan commented 2 years ago

Done!

GenieTim commented 2 years ago

Thanks! As seen in #20, you probably still have to follow https://packagist.org/about#how-to-update-packages to actually make it installable the easy way :)

khanamiryan commented 2 years ago

Hope now it's ok.

GenieTim commented 2 years ago

This commit breaks compatibility with PHP < 8.1

Yes. That's why I say "Require PHP 8.1" as one of the features. It seems, I have not pushed https://github.com/GenieTim/php-qrcode-detector-decoder/commit/5562db75786438a29cdabd3d3619afedbe205400 on time, unfortunately, as otherwise Composer would have taken care of it.

You can simply specify the "absolute" version 1.0.5.2 in composer.json to prevent the auto-upgrade.

kasn commented 2 years ago

thank you very much for that change, highly appreciated.

I still think such a change needs to be a major version