diff --git a/src/ValueObject/ServiceDefinition.php b/src/ValueObject/ServiceDefinition.php index 5233217bc..1d992ee4a 100644 --- a/src/ValueObject/ServiceDefinition.php +++ b/src/ValueObject/ServiceDefinition.php @@ -16,6 +16,7 @@ public function __construct( private ?string $class, private bool $isPublic, private bool $isSynthetic, + private bool $isShared, private ?string $alias, private array $tags ) { @@ -41,6 +42,11 @@ public function isSynthetic(): bool return $this->isSynthetic; } + public function isShared(): bool + { + return $this->isShared; + } + public function getAlias(): ?string { return $this->alias; diff --git a/src/ValueObjectFactory/ServiceMapFactory.php b/src/ValueObjectFactory/ServiceMapFactory.php index 18db8d735..e3d16aa44 100644 --- a/src/ValueObjectFactory/ServiceMapFactory.php +++ b/src/ValueObjectFactory/ServiceMapFactory.php @@ -113,6 +113,10 @@ private function createServiceFromXmlAndTagsData(SimpleXMLElement $attrs, array $attrs, 'synthetic' ) && $attrs->synthetic instanceof SimpleXMLElement && (string) $attrs->synthetic === 'true', + ! (property_exists( + $attrs, + 'shared' + ) && $attrs->shared instanceof SimpleXMLElement) || (string) $attrs->shared !== 'false', property_exists( $attrs, 'alias' @@ -144,6 +148,7 @@ private function createAliasServiceDefinitions(array $aliases, array $services): $services[$alias]->getClass(), $service->isPublic(), $service->isSynthetic(), + $service->isShared(), $alias, [] );