You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
symfony/dependency-injection v5.3.3 is pinned to psr/container:^1.1.1.
symfony/service-contracts v2.4.0 is pinned to psr/container:^1.1.
psr/container:^2 is now available. The changes between v1 and v2 are technically BC-breaking and present a compatibility issue. As such, they should probably only be done in a major release. However, the actual code changes required are minor enough that upgrading won't require much effort in that regard. I'm happy to submit these changes as a formal PR if there's consensus on if / when to implement them.
service-contracts needs its composer.json file updated and a bool typehint added to ServiceLocatorTrait->has().
dependency-injection needs its composer.json file updated and a bool typehint added to Container->has(), ContainerBuilder->has(), ContainerInterface->has(), and ParameterBag\ContainerBag->has().
diff --git a/composer.json b/composer.json
index 65777679..bd75a893 100644
--- a/composer.json+++ b/composer.json@@ -17,11 +17,21 @@
],
"require": {
"php": ">=7.2.5",
- "psr/container": "^1.1.1",+ "psr/container": "^2",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
diff --git a/Container.php b/Container.php
index f096c75c..0ed5829a 100644
--- a/Container.php+++ b/Container.php@@ -186,7 +186,7 @@ class Container implements ContainerInterface, ResetInterface
*
* @return bool true if the service is defined, false otherwise
*/
- public function has(string $id)+ public function has(string $id): bool
{
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
diff --git a/ContainerBuilder.php b/ContainerBuilder.php
index d8d356ad..f006df08 100644
--- a/ContainerBuilder.php+++ b/ContainerBuilder.php@@ -518,7 +518,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @return bool true if the service is defined, false otherwise
*/
- public function has(string $id)+ public function has(string $id): bool
{
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
}
diff --git a/ContainerInterface.php b/ContainerInterface.php
index 97da9a72..8e5da8c7 100644
--- a/ContainerInterface.php+++ b/ContainerInterface.php@@ -53,7 +53,7 @@ interface ContainerInterface extends PsrContainerInterface
/**
* @return bool true if the service is defined, false otherwise
*/
- public function has(string $id);+ public function has(string $id): bool;
/**
* Check for whether or not a service has been initialized.
diff --git a/ParameterBag/ContainerBag.php b/ParameterBag/ContainerBag.php
index 025fdaf2..295f16b6 100644
--- a/ParameterBag/ContainerBag.php+++ b/ParameterBag/ContainerBag.php@@ -48,7 +48,7 @@ class ContainerBag extends FrozenParameterBag implements ContainerBagInterface
*
* @return bool
*/
- public function has(string $name)+ public function has(string $name): bool
{
return $this->container->hasParameter($name);
}
The text was updated successfully, but these errors were encountered:
@nicolas-grekas we will need to bump symfony/service-contracts to 3.0 requiring psr/container 2.0. Then, in 6.0, we can have symfony/dependency-injection supporting both versions of symfony/service-contracts (to ease migration).
And for packages consuming our interface (rather than implementing), we should support both versions of symfony/service-contracts too (maybe even in 5.4)
symfony/dependency-injection
v5.3.3 is pinned topsr/container:^1.1.1
.symfony/service-contracts
v2.4.0 is pinned topsr/container:^1.1
.psr/container:^2
is now available. The changes between v1 and v2 are technically BC-breaking and present a compatibility issue. As such, they should probably only be done in a major release. However, the actual code changes required are minor enough that upgrading won't require much effort in that regard. I'm happy to submit these changes as a formal PR if there's consensus on if / when to implement them.service-contracts
needs itscomposer.json
file updated and abool
typehint added toServiceLocatorTrait->has()
.dependency-injection
needs itscomposer.json
file updated and abool
typehint added toContainer->has()
,ContainerBuilder->has()
,ContainerInterface->has()
, andParameterBag\ContainerBag->has()
.The text was updated successfully, but these errors were encountered: