Skip to content

allow psr/2 and 3 #29

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

Closed
wants to merge 1 commit into from
Closed

allow psr/2 and 3 #29

wants to merge 1 commit into from

Conversation

tacman
Copy link

@tacman tacman commented Jan 24, 2025

This at least allows this package to be installed with the default symfony packages (via --webapp)

This at least allows this package to be installed with the default symfony packages (via --webapp)
@bocharsky-bw
Copy link
Member

Thanks! I suppose failed tests are related to this PR?

@tacman
Copy link
Author

tacman commented Jan 29, 2025

Indeed, this is where I get confused about plug-and-play http clients.

The goal, of course, is to be able to install this package after

symfony new translation-demo --webapp  && cd translation-demo
composer require php-translation/translator
                                  
 [OK] Your project is now ready in /home/tac/trash/translation-demo                                                     
                                                                                                                        

./composer.json has been updated
Running composer update php-translation/translator
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 php-translation/translator * -> satisfiable by php-translation/translator[0.1.0, 0.1.1, 0.1.2, 0.1.3, 1.0.0, 1.1.0, 1.2.0].
    - php-translation/translator[0.1.0, ..., 0.1.3, 1.0.0] require php ^5.5 || ^7.0 -> your php version (8.4.3) does not satisfy that requirement.
    - php-translation/translator 1.1.0 requires php ^5.6 || ^7.0 -> your php version (8.4.3) does not satisfy that requirement.
    - php-translation/translator 1.2.0 requires psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 3.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require php-translation/translator:*" to figure out if any version is installable, or "composer require php-translation/translator:^2.1" if you know which you need.

@bocharsky-bw
Copy link
Member

Yeah, I understand that we need to allow v3 of psr/log, but will it work if tests still fail? I mean, if we merge this PR - most probably things will still not work anyway for the latest Symfony as failed tests show, right?

@tacman
Copy link
Author

tacman commented Feb 4, 2025

I dunno. I don't understand why it would fail allowing psr-log/3, but I find most of those failures not to be relevant.

But it's really hard to even install this bundle on any modern application because of this. And so it feels like in order to preserve compatibility with EOL versions, we sacrificing usability in current ones.

We want this to work without telling developers that they have to revert to a years-old library.

symfony new translation-demo --webapp  && cd translation-demo
composer require php-translation/translator

@bocharsky-bw
Copy link
Member

PHP Fatal error: Declaration of Translation\Translator\Translator::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void in /home/runner/work/translator/translator/src/Translator.php on line 84

It seems this is the problem. So we need to fix the compatibility, I hope it would not break legacy though.

Also, some SA tools like PHP CS Fixer and PHPStan builds are failed too. We need to make them green to move forward on it. I also think we should enable PHP 8.3/8.4 in CI, but probably it's good to do in a new PR. Do you want to make the PR?

@tacman
Copy link
Author

tacman commented Feb 5, 2025

Sure. Can we drop some of the PHP versions in the CI?

@tacman tacman closed this by deleting the head repository Feb 5, 2025
@bocharsky-bw
Copy link
Member

Yes, definitely, I think we can keep the only keep 8.3/8.4, but add extra builds to test lowest/highest as it's done so far in the CI, WDYT? Feel free to open a PR to discuss changes there

@tacman
Copy link
Author

tacman commented Feb 12, 2025

So it's there anything we can do to allow this to work?

symfony new translation-demo --webapp  && cd translation-demo
composer require php-translation/translator

@bocharsky-bw
Copy link
Member

Yes, that sounds like we should allow the latest psr/log to me, i.e. something you did in this PR

@tacman
Copy link
Author

tacman commented Mar 1, 2025

So this PR was closed, yet

symfony new translation-demo --webapp  && cd translation-demo
composer require php-translation/translator:dev-master

still shows

composer require php-translation/translator:dev-master
./composer.json has been updated
Running composer update php-translation/translator
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 php-translation/translator dev-master -> satisfiable by php-translation/translator[dev-master].
    - php-translation/translator dev-master requires psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 3.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
~/trash/translation-demo$ 

@bocharsky-bw
Copy link
Member

IIRC it was closed by you so it wasn't merged at all, so it makes sense things are still not work

@tacman
Copy link
Author

tacman commented Mar 3, 2025

OK, I've resubmitted a PR.

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.

2 participants