laminas / laminas-servicemanager

Factory-Driven Dependency Injection Container
https://docs.laminas.dev/laminas-servicemanager/
BSD 3-Clause "New" or "Revised" License
152 stars 59 forks source link

Changes to AbstractFactoryInterface are breaking other components #197

Closed mtouellette closed 1 year ago

mtouellette commented 1 year ago

BC Break Report

Q A
Version 3.21

Summary

Components (laminas/laminas-cache and articus/path-handler to name a couple) are throwing fatal errors after an update to version 3.21 (3.20 is fine). Changes to other interfaces (i.e. FactoryInterface) are likely also an issue.

Previous behavior

Everything worked wonderfully

Current behavior

PHP Fatal error:
Declaration of Laminas\Cache\Service\StorageCacheAbstractServiceFactory::canCreate(Psr\Container\ContainerInterface $container, $requestedName) must be compatible with Laminas\ServiceManager\Factory\AbstractFactoryInterface::canCreate(Psr\Container\ContainerInterface $container, string $requestedName): bool in C:\Apache24\htdocs\rcm-api\vendor\laminas\laminas-cache\src\Service\StorageCacheAbstractServiceFactory.php on line 33

How to reproduce

Run code that uses laminas/laminas-cache 3.11 and laminas/laminas-servicemanager 3.21

Ocramius commented 1 year ago

@mtouellette do you know which commit introduced this regression, perhaps? 🤔

Xerkus commented 1 year ago

I am out of my game today. Misread the issue twice.

@mtouellette you are installing -dev version instead of tagged release. I suggest you change minimum stability setting in your composer to not install dev dependencies https://getcomposer.org/doc/04-schema.md#minimum-stability or at minimum add prefer stable https://getcomposer.org/doc/04-schema.md#prefer-stable

@laminas/technical-steering-committee we've got a problem: renovate must be disallowed from ever automerging PR if PR had to be created in the first place: https://github.com/laminas/laminas-servicemanager/pull/185 Default branch changed on release and renovate auto-merged previously opened PR against old default branch with commits from new default branch.

mtouellette commented 1 year ago

Setting prefer-stable did the trick. Thank you!

Xerkus commented 1 year ago

Changes reversed by force push to dev branch.

@mtouellette thank you for bringing this to our attention.