diff --git a/Argument/LazyClosure.php b/Argument/LazyClosure.php index 3e8718643..3dcc34e4f 100644 --- a/Argument/LazyClosure.php +++ b/Argument/LazyClosure.php @@ -12,7 +12,6 @@ namespace Symfony\Component\DependencyInjection\Argument; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; diff --git a/Compiler/AttributeAutoconfigurationPass.php b/Compiler/AttributeAutoconfigurationPass.php index 9c0eec543..bbf341913 100644 --- a/Compiler/AttributeAutoconfigurationPass.php +++ b/Compiler/AttributeAutoconfigurationPass.php @@ -67,14 +67,14 @@ public function process(ContainerBuilder $container): void foreach (['class', 'method', 'property', 'parameter'] as $symbol) { if (['Reflector'] !== $types) { - if (!\in_array('Reflection' . ucfirst($symbol), $types, true)) { + if (!\in_array('Reflection'.ucfirst($symbol), $types, true)) { continue; } - if (!($targets & \constant('Attribute::TARGET_' . strtoupper($symbol)))) { - throw new LogicException(\sprintf('Invalid type "Reflection%s" on argument "$%s": attribute "%s" cannot target a ' . $symbol . ' in "%s" on line "%d".', ucfirst($symbol), $reflectorParameter->getName(), $attributeName, $callableReflector->getFileName(), $callableReflector->getStartLine())); + if (!($targets & \constant('Attribute::TARGET_'.strtoupper($symbol)))) { + throw new LogicException(\sprintf('Invalid type "Reflection%s" on argument "$%s": attribute "%s" cannot target a '.$symbol.' in "%s" on line "%d".', ucfirst($symbol), $reflectorParameter->getName(), $attributeName, $callableReflector->getFileName(), $callableReflector->getStartLine())); } } - $this->{$symbol . 'AttributeConfigurators'}[$attributeName][] = $callable; + $this->{$symbol.'AttributeConfigurators'}[$attributeName][] = $callable; } } } diff --git a/Compiler/ResolveInstanceofConditionalsPass.php b/Compiler/ResolveInstanceofConditionalsPass.php index 52dc56c0f..8b0a804dc 100644 --- a/Compiler/ResolveInstanceofConditionalsPass.php +++ b/Compiler/ResolveInstanceofConditionalsPass.php @@ -112,8 +112,8 @@ private function processDefinition(ContainerBuilder $container, string $id, Defi $definition = substr_replace($definition, '53', 2, 2); $definition = substr_replace($definition, 'Child', 44, 0); } - $definition = unserialize($definition); /** @var ChildDefinition $definition */ + $definition = unserialize($definition); $definition->setParent($parent); if (null !== $shared && !isset($definition->getChanges()['shared'])) { diff --git a/ContainerBuilder.php b/ContainerBuilder.php index 38208124d..f3f86f9f3 100644 --- a/ContainerBuilder.php +++ b/ContainerBuilder.php @@ -1500,8 +1500,8 @@ public function getAutoconfiguredAttributes(): array $autoconfiguredAttributes = []; foreach ($this->autoconfiguredAttributes as $attribute => $configurators) { - if (count($configurators) > 1) { - throw new LogicException(\sprintf('The "%s" attribute has %d configurators. Use "getAttributeAutoconfigurators()" to get all of them.', $attribute, count($configurators))); + if (\count($configurators) > 1) { + throw new LogicException(\sprintf('The "%s" attribute has %d configurators. Use "getAttributeAutoconfigurators()" to get all of them.', $attribute, \count($configurators))); } $autoconfiguredAttributes[$attribute] = $configurators[0];