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

Compatibility broken with PHP < 8.1 #124

Open
remicollet opened this issue Jun 30, 2022 · 6 comments
Open

Compatibility broken with PHP < 8.1 #124

remicollet opened this issue Jun 30, 2022 · 6 comments

Comments

@remicollet
Copy link
Contributor

Despite composer have

  "require": {
    "php": ">=5.6"
  },

$ php80 /usr/bin/phpunit9 --verbose
PHPUnit 9.5.21 #StandWithUkraine

Runtime:       PHP 8.0.21RC1
Configuration: /dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/phpunit.xml.dist

EE                                                                  2 / 2 (100%)

Time: 00:00.003, Memory: 4.00 MB

There were 2 errors:

1) Khanamiryan\QrCodeTests\QrReaderTest::testText1
ParseError: syntax error, unexpected fully qualified name "\Zxing\BinaryBitmap", expecting variable

/dev/shm/BUILDROOT/php-khanamiryan-qrcode-detector-decoder-1.0.6-1.fc35.remi.x86_64/usr/share/php/Zxing/QrReader.php:14
/usr/share/php/Fedora/Autoloader/Autoload.php:212
/dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/tests/QrReaderTest.php:14

2) Khanamiryan\QrCodeTests\QrReaderTest::testNoText
Error: Class "Zxing\QrReader" not found

/dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/tests/QrReaderTest.php:21

ERRORS!
Tests: 2, Assertions: 0, Errors: 2.


$ php74 /usr/bin/phpunit9 --verbose
PHPUnit 9.5.21 #StandWithUkraine

Runtime:       PHP 7.4.30
Configuration: /dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/phpunit.xml.dist

EE                                                                  2 / 2 (100%)

Time: 00:00.004, Memory: 4.00 MB

There were 2 errors:

1) Khanamiryan\QrCodeTests\QrReaderTest::testText1
ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE)

/dev/shm/BUILDROOT/php-khanamiryan-qrcode-detector-decoder-1.0.6-1.fc35.remi.x86_64/usr/share/php/Zxing/QrReader.php:16
/usr/share/php/Fedora/Autoloader/Autoload.php:212
/dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/tests/QrReaderTest.php:14

2) Khanamiryan\QrCodeTests\QrReaderTest::testNoText
Error: Class 'Zxing\QrReader' not found

/dev/shm/BUILD/php-qrcode-detector-decoder-45326fb83a2a375065dbb3a134b5b8a5872da569/tests/QrReaderTest.php:21

ERRORS!
Tests: 2, Assertions: 0, Errors: 2.

@remicollet
Copy link
Contributor Author

Related to 37269d3

@limingxinleo
Copy link
Contributor

> phpstan analyse --memory-limit 1G -l 0 -c phpstan.neon ./app ./config
 739/739 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------------------------- 
  Line   app/Kernel/Helper/QrHelper.php                                       
 ------ --------------------------------------------------------------------- 
  22     Instantiated class Zxing\QrReader not found.                         
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols   
 ------ --------------------------------------------------------------------- 

@GenieTim
Copy link
Contributor

GenieTim commented Jul 3, 2022

Yes, also seen in #126

@remicollet
Copy link
Contributor Author

I notice 2.0.0 was release (I don't see any value in bumping major version when minimal required PHP is changed)

The main issue, is that 1.0.6 is still there
https://packagist.org/packages/khanamiryan/qrcode-detector-decoder

And will break any installation with PHP 8.1

@GenieTim
Copy link
Contributor

GenieTim commented Jul 5, 2022

I disagree with the "no value in major when minimal PHP version changes", but that's a discussion for another day.

The maintainer kindly deleted the version from the GitHub releases page.
It seems this is not sufficient.
What possibility is there to get rid of 1.0.6 then?

@giosh94mhz
Copy link

What possibility is there to get rid of 1.0.6 then?

To the maintainer

The package must be removed from packagist too, but probabily the best thing to do it's a 1.0.7 release which rolls back the latest modification.

To everyone else

Add a conflict in composer.json of your project:

"conflict": {
        "khanamiryan/qrcode-detector-decoder": "~1.0.6"
},

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

No branches or pull requests

4 participants