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

psr/container v2 breaks other components #146

Closed
remicollet opened this issue Jul 20, 2022 · 6 comments
Closed

psr/container v2 breaks other components #146

remicollet opened this issue Jul 20, 2022 · 6 comments
Assignees
Labels
Bug Something isn't working

Comments

@remicollet
Copy link
Contributor

Since v2 is allowed, example for laminas-inputfilter

$ composer update
...
  - Locking laminas/laminas-servicemanager (3.15.0)
  - Locking psr/container (2.0.2)
...

And then

$ vendor/bin/phpunit 
PHPUnit 9.5.21 #StandWithUkraine

.............................................................   61 / 1092 (  5%)
.............................................................  122 / 1092 ( 11%)
.............................................................  183 / 1092 ( 16%)
.............................................................  244 / 1092 ( 22%)
.............................................................  305 / 1092 ( 27%)
.............................................................  366 / 1092 ( 33%)
.............................................................  427 / 1092 ( 39%)
.............................................................  488 / 1092 ( 44%)
S...S.......SSSS.............................................  549 / 1092 ( 50%)
.......................................S...S.....SSSS........  610 / 1092 ( 55%)
.............................................................  671 / 1092 ( 61%)
........S.................ESS................................  732 / 1092 ( 67%)
.............................................................  793 / 1092 ( 72%)
.............................................................  854 / 1092 ( 78%)
.............................................................  915 / 1092 ( 83%)
.............................................................  976 / 1092 ( 89%)
............................................................. 1037 / 1092 ( 94%)
.......................................................       1092 / 1092 (100%)

Time: 00:00.099, Memory: 18,00 MB

There was 1 error:

1) LaminasTest\InputFilter\InputFilterPluginManagerFactoryTest::testFactoryReturnsPluginManager
TypeError: Double\ContainerInterface\P8::has(): Return value must be of type bool, null returned

/work/GIT/laminas/laminas-inputfilter/src/InputFilterPluginManagerFactory.php:43
/work/GIT/laminas/laminas-inputfilter/test/InputFilterPluginManagerFactoryTest.php:24

ERRORS!
Tests: 1092, Assertions: 4359, Errors: 1, Skipped: 15.

Other components may be affected (laminas-hydrator, laminas-servicemanager-di)
despite these have no direct dependency on psr/container

@remicollet remicollet added the Bug Something isn't working label Jul 20, 2022
@Ocramius
Copy link
Member

Indeed, seen in laminas/laminas-feed#59

It's generally super-annoying, so we're thinking of rolling back psr/container:^2 support :-\

@Ocramius Ocramius added this to the 3.15.1 milestone Jul 20, 2022
@Ocramius
Copy link
Member

Meanwhile, configuring renovate on laminas-inputfilter, so this bug pops up in a PR tomorrow morning.

@Ocramius
Copy link
Member

Hmm, I think Double\ContainerInterface\P8::has() is just broken here: should always have returned a boolean.

Will adjust.

Ocramius added a commit to Ocramius/laminas-inputfilter that referenced this issue Jul 20, 2022
…ol` instead of `null`

This is necessary, as `psr/container:^2` has a stricter return type declaration, and prophecy is
not respecting the return types upfront (unless stubbed methods are explicitly configured).

While this is an upstream BC break in `psr/container:^2`, this component is not really affected
by the BC issue, other than some stubbing being broken in it.

Fixes:

```
1) LaminasTest\InputFilter\InputFilterPluginManagerFactoryTest::testFactoryConfiguresPluginManagerUnderContainerInterop with data set "input" ('Laminas\InputFilter\InputInterface')
TypeError: Double\ContainerInterface\P8::has(): Return value must be of type bool, null returned
2) LaminasTest\InputFilter\InputFilterPluginManagerFactoryTest::testFactoryConfiguresPluginManagerUnderContainerInterop with data set "input-filter" ('Laminas\InputFilter\InputFilt...erface')
TypeError: Double\ContainerInterface\P8::has(): Return value must be of type bool, null returned
```

Ref: laminas/laminas-servicemanager#146 (comment)
Ref: laminas/laminas-servicemanager#146 (comment)
@Ocramius
Copy link
Member

Closing here, fixed in laminas-inputfilter.

Although the issue with psr/container:^2 exists elsewhere, it no longer exists on this specific case.

Please report other failures as you encounter them 👍

@Ocramius Ocramius removed this from the 3.15.1 milestone Jul 20, 2022
@Ocramius Ocramius self-assigned this Jul 20, 2022
@Ocramius
Copy link
Member

Ref: #147

@Ocramius
Copy link
Member

https://github.com/laminas/laminas-servicemanager/releases/tag/3.15.1 should fix this: sad to see that work reverted, but our hopes that it would work were unfounded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants