laminas / laminas-servicemanager

Factory-Driven Dependency Injection Container

Home Page:https://docs.laminas.dev/laminas-servicemanager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changes to AbstractFactoryInterface are breaking other components

mtouellette opened this issue · comments

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

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

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: #185
Default branch changed on release and renovate auto-merged previously opened PR against old default branch with commits from new default branch.

Setting prefer-stable did the trick. Thank you!

Changes reversed by force push to dev branch.

@mtouellette thank you for bringing this to our attention.