Meteo-Concept / hcaptcha-bundle

A Symfony 4+ bundle to bring hCaptcha into your forms
Other
22 stars 10 forks source link

meteo-concept/hcaptcha-bundle conflicts with Symfony 5.2.* #3

Closed karmek-k closed 3 years ago

karmek-k commented 3 years ago

It seems that the bundle can't be installed with symfony/http-client of version >=5.2.

$ composer require meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7
Using version ^0.1.0@alpha for meteo-concept/hcaptcha-bundle
Using version ^1.4 for nyholm/psr7
./composer.json has been updated
Running composer update meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires meteo-concept/hcaptcha-bundle ^0.1.0@alpha -> satisfiable by meteo-concept/hcaptcha-bundle[v0.1.0-alpha].
    - meteo-concept/hcaptcha-bundle v0.1.0-alpha requires symfony/http-client >=4.3 <5.2 -> found symfony/http-client[v4.3.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.1.x-dev] but it conflicts with your root composer.json require
(5.2.*).

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
lgeorget commented 3 years ago

Thank you for the report, I've not tested it in depth under Symfony 5.2 yet. Is there a specific reason you want v0.1.0-alpha instead of v1.1.2 though?

lgeorget commented 3 years ago

I've just created a brand new Symfony 5.2 project and immediately did "composer require meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7". Composer installed meteo-concept/hcaptcha-bundle v1.1.2 without issue. v0.1.0-alpha has weird constraint preventing symfony >= 5.2 which date back from a time I was tracking a breaking change bug.

Maybe there's something weird going on with your composer.json. Can you try setting the version of the hcaptcha-bundle to ^1.1 in the composer.json and run a composer upgrade?

karmek-k commented 3 years ago

Okay, I executed composer require meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7 and now composer installed version ^2.0. There were no issues while installing.

I have no idea why composer required v0.1.0-alpha of the bundle, but it seems that executing the above command now installs the correct version.

However, there was a warning saying:

Class MeteoConcept\HCaptchaBundle\Tests\Form\DataTransformer\HCaptchaValueFetcherTest located in C:/Users/Bartosz/source/php/mijikasa/vendor/meteo-concept/hcaptcha-bundle\Tests\Form\DataTransformer\HCatchaValueFetcherTest.php does n
ot comply with psr-4 autoloading standard. Skipping.

I guess it's not that important for the end user. Despite this warning, hCaptcha works properly.

Anyway, thank you for your support and sorry for late response.

lgeorget commented 3 years ago

Yes, meanwhile, I released version 2.0 to drop support for PHP7.1 and add support for PHP8.0. :-)

Hmm, indeed, it shouldn't be an issue for end-users since it's a unit-testing class. Actually, it's quite silly. The file is named "HCatchaValueFetcherTest.php" instead of "HCaptchaValueFetcherTest.php" and since it's a testing file, it actually doesn't trigger any error from Symfony or during the tests. I'm at the point I need to unit-tests my unit tests...

Thank you!