*/ class DefinitionNormalizer { /** @var Autowiring */ private $autowiring; public function __construct(Autowiring $autowiring) { $this->autowiring = $autowiring; } /** * Normalize a definition that is *not* nested in another one. * * This is usually a definition declared at the root of a definition array. * * @param mixed $definition * @param string $name The definition name. * @param string[] $wildcardsReplacements Replacements for wildcard definitions. * * @throws InvalidDefinition */ public function normalizeRootDefinition($definition, string $name, array $wildcardsReplacements = null): Definition { if ($definition instanceof DefinitionHelper) { $definition = $definition->getDefinition($name); } elseif (is_array($definition)) { $definition = new ArrayDefinition($definition); } elseif ($definition instanceof \Closure) { $definition = new FactoryDefinition($name, $definition); } elseif (! $definition instanceof Definition) { $definition = new ValueDefinition($definition); } // For a class definition, we replace * in the class name with the matches // *Interface -> *Impl => FooInterface -> FooImpl if ($wildcardsReplacements && $definition instanceof ObjectDefinition) { $definition->replaceWildcards($wildcardsReplacements); } if ($definition instanceof AutowireDefinition) { $definition = $this->autowiring->autowire($name, $definition); } $definition->setName($name); try { $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']); } catch (InvalidDefinition $e) { throw InvalidDefinition::create($definition, sprintf( 'Definition "%s" contains an error: %s', $definition->getName(), $e->getMessage() ), $e); } return $definition; } /** * Normalize a definition that is nested in another one. * * @param mixed $definition * @return mixed * * @throws InvalidDefinition */ public function normalizeNestedDefinition($definition) { $name = ''; if ($definition instanceof DefinitionHelper) { $definition = $definition->getDefinition($name); } elseif (is_array($definition)) { $definition = new ArrayDefinition($definition); } elseif ($definition instanceof \Closure) { $definition = new FactoryDefinition($name, $definition); } if ($definition instanceof DecoratorDefinition) { throw new InvalidDefinition('Decorators cannot be nested in another definition'); } if ($definition instanceof AutowireDefinition) { $definition = $this->autowiring->autowire($name, $definition); } if ($definition instanceof Definition) { $definition->setName($name); // Recursively traverse nested definitions $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']); } return $definition; } } __halt_compiler();----SIGNATURE:----N8Wk0qwgmrxztfpk2Q4JJ9N3nkzfjcicvVN7PKqwqJOAxe3//fDOl6kl1qlZyg5w2om76IG+CxZV/Z2WjPFLuOVwuKYr3Cja5dDA6IEKIqKeePAbxpTKMj+mxTXtQjgSp4CH9PGjMb2QUY7EUOpUiIBGOPBZYPnVace5ElUBi++IOh6Y3YHMzGpOs5MfZu+cTMfNp5bIjmGnlNFIWtWwZ0L8Gwy9slAmz6wFA5OltS7sOvRAYXAR55k/zsM2LBS8V3JX1EZi7oVFpKpB9/RazAtuRpoN5J6KWyH8lUoVaUXJi90dcqn4n/M4zCBVRz4ObZgM1LfEcIfOsVtVxWtLMLcoBZMH9cmgdHZKg0AgIi8JwLGo8PBikr/lVpsq39JLs5l9YC5ZsmInJpp6t9WzAuzzEDvhidGu/cXgnXcMq/DyypWQe3Su/WBTMP9ZF2jFWvARDvVD7ConACtmnaHI93frIYQT9Rc+xb44coxAu/uPkMhIYwaw2dYKDlATXcO8DVctFcN1TwXe3NlYj8U57o537AHC1dDwowqs0hfMdDTP0GbqDNhSohghhiGgJrI4NC+vRebS4Bt6FmWbiejtozMMlhLaIaAYC2UGIvriRRdxJOF6hZ9fYAs9DGMS/dbM1kEuxPZPR0gycO9jUV8FwkxckjOibSc9/bc8syIXXTI=----ATTACHMENT:----MTc5OTgyODkzMTc1MjE3IDg5NzY2NDY3NTgzMTg1OSAyNDg4NTE5MjQzMTU5OTU0