* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\DependencyInjection; use Psr\Container\ContainerInterface; use Symfony\Component\Form\FormExtensionInterface; use Symfony\Component\Form\FormTypeGuesserChain; use Symfony\Component\Form\Exception\InvalidArgumentException; class DependencyInjectionExtension implements FormExtensionInterface { private $guesser; private $guesserLoaded = false; private $typeContainer; private $typeExtensionServices; private $guesserServices; // @deprecated to be removed in Symfony 4.0 private $typeServiceIds; private $guesserServiceIds; /** * @param ContainerInterface $typeContainer * @param iterable[] $typeExtensionServices * @param iterable $guesserServices */ public function __construct(ContainerInterface $typeContainer, array $typeExtensionServices, $guesserServices, array $guesserServiceIds = null) { if (null !== $guesserServiceIds) { @trigger_error(sprintf('Passing four arguments to the %s::__construct() method is deprecated since Symfony 3.3 and will be disallowed in Symfony 4.0. The new constructor only accepts three arguments.', __CLASS__), E_USER_DEPRECATED); $this->guesserServiceIds = $guesserServiceIds; $this->typeServiceIds = $typeExtensionServices; $typeExtensionServices = $guesserServices; $guesserServices = $guesserServiceIds; } $this->typeContainer = $typeContainer; $this->typeExtensionServices = $typeExtensionServices; $this->guesserServices = $guesserServices; } public function getType($name) { if (null !== $this->guesserServiceIds) { if (!isset($this->typeServiceIds[$name])) { throw new InvalidArgumentException(sprintf('The field type "%s" is not registered in the service container.', $name)); } return $this->typeContainer->get($this->typeServiceIds[$name]); } if (!$this->typeContainer->has($name)) { throw new InvalidArgumentException(sprintf('The field type "%s" is not registered in the service container.', $name)); } return $this->typeContainer->get($name); } public function hasType($name) { if (null !== $this->guesserServiceIds) { return isset($this->typeServiceIds[$name]); } return $this->typeContainer->has($name); } public function getTypeExtensions($name) { $extensions = array(); if (isset($this->typeExtensionServices[$name])) { foreach ($this->typeExtensionServices[$name] as $serviceId => $extension) { if (null !== $this->guesserServiceIds) { $extension = $this->typeContainer->get($serviceId = $extension); } $extensions[] = $extension; // validate result of getExtendedType() to ensure it is consistent with the service definition if ($extension->getExtendedType() !== $name) { throw new InvalidArgumentException( sprintf('The extended type specified for the service "%s" does not match the actual extended type. Expected "%s", given "%s".', $serviceId, $name, $extension->getExtendedType() ) ); } } } return $extensions; } public function hasTypeExtensions($name) { return isset($this->typeExtensionServices[$name]); } public function getTypeGuesser() { if (!$this->guesserLoaded) { $this->guesserLoaded = true; $guessers = array(); foreach ($this->guesserServices as $serviceId => $service) { if (null !== $this->guesserServiceIds) { $service = $this->typeContainer->get($serviceId = $service); } $guessers[] = $service; } if ($guessers) { $this->guesser = new FormTypeGuesserChain($guessers); } } return $this->guesser; } } __halt_compiler();----SIGNATURE:----JsSqQyJk8FfdTOIQg0H38MfRUSanexU49QirwUICAf4YS64typRC0bxkUfrCJ6eyFJduYUgm2LBbgO8OVjXNhvYPJHeDKFRA8gclaZwSA7Qlu/GmrZc07puzChF7mWBdGu8u79IUPLfqCaG9K+Jml26YsvSaWE7EXHaHAY8rijsJhc3SSW2YU+sXDWx+is+HEqkzB+fUsrIRdA6iGv8TN8gXcos2aUwRU2ICqRURGQfSA4iPFcvhz9IpBQir61cyunnn0DT4LLsVBwnFrguUNw1E/Sb0UknlYuUeujpWTSY+Ew27YwL2osE/1LFM4uBCwDdiljQVWxRbFgEmi/gWplyRuAa+SfEivMRqIUwraOvuNT179MHk6egTXycyAjcegxjCXhkJDFdTsWhEJRY+hTYQOCWonGqzYw3LkvZUr8WuIx1fxGCZ0lF5Qu2hDbT/P0ESE2jpqEbWCzpPSQQq+fh7LA8ZEI47HRBeIHFq0+1MtupunRb8L58lzfh6bX6KqNRKU3PRwh67Z+H7brgF0UeK88/4QDkP20YHGxC48HSsrgzqGPXpdhuyfD984KqWMkJYicynJYn2YGvPRCoYll4V746azCxn7VwhstMf7UjaiMmRSMFk29oTYF7PpomMbD4j3ck4gOdMiUc7jsuI6uJhL4UhjPnNYrV/sC/I37g=----ATTACHMENT:----NDE1NDYzNDE5ODk4MzcxNSA2MzQ0MjU2OTUyMTUwOTI0IDc5MDE0NTI2NjExMjM5MTY=