* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; /** * @author Nicolas Grekas * * @method InstanceofConfigurator instanceof($fqcn) */ class ServicesConfigurator extends AbstractConfigurator { const FACTORY = 'services'; private $defaults; private $container; private $loader; private $instanceof; public function __construct(ContainerBuilder $container, PhpFileLoader $loader, array &$instanceof) { $this->defaults = new Definition(); $this->container = $container; $this->loader = $loader; $this->instanceof = &$instanceof; $instanceof = array(); } /** * Defines a set of defaults for following service definitions. * * @return DefaultsConfigurator */ final public function defaults() { return new DefaultsConfigurator($this, $this->defaults = new Definition()); } /** * Defines an instanceof-conditional to be applied to following service definitions. * * @param string $fqcn * * @return InstanceofConfigurator */ final protected function setInstanceof($fqcn) { $this->instanceof[$fqcn] = $definition = new ChildDefinition(''); return new InstanceofConfigurator($this, $definition, $fqcn); } /** * Registers a service. * * @param string $id * @param string|null $class * * @return ServiceConfigurator */ final public function set($id, $class = null) { $defaults = $this->defaults; $allowParent = !$defaults->getChanges() && empty($this->instanceof); $definition = new Definition(); $definition->setPublic($defaults->isPublic()); $definition->setAutowired($defaults->isAutowired()); $definition->setAutoconfigured($defaults->isAutoconfigured()); $definition->setBindings($defaults->getBindings()); $definition->setChanges(array()); $configurator = new ServiceConfigurator($this->container, $this->instanceof, $allowParent, $this, $definition, $id, $defaults->getTags()); return null !== $class ? $configurator->class($class) : $configurator; } /** * Creates an alias. * * @param string $id * @param string $referencedId * * @return AliasConfigurator */ final public function alias($id, $referencedId) { $ref = static::processValue($referencedId, true); $alias = new Alias((string) $ref, $this->defaults->isPublic()); $this->container->setAlias($id, $alias); return new AliasConfigurator($this, $alias); } /** * Registers a PSR-4 namespace using a glob pattern. * * @param string $namespace * @param string $resource * * @return PrototypeConfigurator */ final public function load($namespace, $resource) { $allowParent = !$this->defaults->getChanges() && empty($this->instanceof); return new PrototypeConfigurator($this, $this->loader, $this->defaults, $namespace, $resource, $allowParent); } /** * Gets an already defined service definition. * * @param string $id * * @return ServiceConfigurator * * @throws ServiceNotFoundException if the service definition does not exist */ final public function get($id) { $allowParent = !$this->defaults->getChanges() && empty($this->instanceof); $definition = $this->container->getDefinition($id); return new ServiceConfigurator($this->container, $definition->getInstanceofConditionals(), $allowParent, $this, $definition, $id, array()); } /** * Registers a service. * * @param string $id * @param string|null $class * * @return ServiceConfigurator */ final public function __invoke($id, $class = null) { return $this->set($id, $class); } } __halt_compiler();----SIGNATURE:----S1mVYfcwD0Az+qNuMj1sTQzwOhsBRNglT/e/ee17n5TEjsFVgALccOxQpCyWhx437gx7+Ra14AO8P98iCZqPXXZ0TP341KMtp0OpROIJD4U7mvP/ORRxcDUPhyyrBuv18j8X8J7toG7iZ4c0t4HkvKnxnTNVumW15KqBK/+JRY5X5N1Bh/e6ijACOdx+U/SMf1aadqKNk+I7z9beQsy/cjnJZ5cPyb7JUrmy5/zNlsRzqejUKg1AH/ByB6PmHenDk+uNYDuISlPXeuw2s4v2CJCEHPkQIN5gEP69eSRtpYMNyv7ATXsdd4bm+TGnnMA1Nm/UW1xQbQgW7oyE4jqSKTUNMXlmoxE/ul1DDRKL+RmoFJWZeQeMzE32qFeF9Svo0fYKWHxF+W/UPGeHLbkar/QaZZCkRtZLiGIEtc7BW5xc7Pu80I3XmPu7uOemFCj6h16HlwolfQZtRLPBONJpnr648gbaYQgi5cjq/5wckqGN/XAOZDjmoSh/Xv3Ho4taXDVGTR1RTNVbBoEd+QmZeRasQzOfbABIkcHAQfDNXS1aczX4qq1W74ArFya4Uan88CpINhK5H8khAvHAImyJ7xNdVsplLm6gMOP+NrHrAG1ifc7SjYpjWEPav5UtnooKq+AfVQNilv2fCucxgFO0arxfv7D7UHmsp0P9wTcAixA=----ATTACHMENT:----OTIyMzI5NzgwODQ2MTMzNCA1Nzg2NTYzNTE1MjgzODQgNzAxMDkyMDg1NDk4NjQzNQ==