Submit
Path:
~
/
/
opt
/
cloudlinux
/
alt-php55
/
root
/
usr
/
share
/
pear
/
Symfony
/
Component
/
Form
/
File Content:
AbstractExtension.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form; use Symfony\Component\Form\Exception\InvalidArgumentException; use Symfony\Component\Form\Exception\UnexpectedTypeException; /** * @author Bernhard Schussek <bschussek@gmail.com> */ abstract class AbstractExtension implements FormExtensionInterface { /** * The types provided by this extension * @var FormTypeInterface[] An array of FormTypeInterface */ private $types; /** * The type extensions provided by this extension * @var FormTypeExtensionInterface[] An array of FormTypeExtensionInterface */ private $typeExtensions; /** * The type guesser provided by this extension * @var FormTypeGuesserInterface */ private $typeGuesser; /** * Whether the type guesser has been loaded * @var Boolean */ private $typeGuesserLoaded = false; /** * {@inheritdoc} */ public function getType($name) { if (null === $this->types) { $this->initTypes(); } if (!isset($this->types[$name])) { throw new InvalidArgumentException(sprintf('The type "%s" can not be loaded by this extension', $name)); } return $this->types[$name]; } /** * {@inheritdoc} */ public function hasType($name) { if (null === $this->types) { $this->initTypes(); } return isset($this->types[$name]); } /** * {@inheritdoc} */ public function getTypeExtensions($name) { if (null === $this->typeExtensions) { $this->initTypeExtensions(); } return isset($this->typeExtensions[$name]) ? $this->typeExtensions[$name] : array(); } /** * {@inheritdoc} */ public function hasTypeExtensions($name) { if (null === $this->typeExtensions) { $this->initTypeExtensions(); } return isset($this->typeExtensions[$name]) && count($this->typeExtensions[$name]) > 0; } /** * {@inheritdoc} */ public function getTypeGuesser() { if (!$this->typeGuesserLoaded) { $this->initTypeGuesser(); } return $this->typeGuesser; } /** * Registers the types. * * @return FormTypeInterface[] An array of FormTypeInterface instances */ protected function loadTypes() { return array(); } /** * Registers the type extensions. * * @return FormTypeExtensionInterface[] An array of FormTypeExtensionInterface instances */ protected function loadTypeExtensions() { return array(); } /** * Registers the type guesser. * * @return FormTypeGuesserInterface|null A type guesser */ protected function loadTypeGuesser() { return null; } /** * Initializes the types. * * @throws UnexpectedTypeException if any registered type is not an instance of FormTypeInterface */ private function initTypes() { $this->types = array(); foreach ($this->loadTypes() as $type) { if (!$type instanceof FormTypeInterface) { throw new UnexpectedTypeException($type, 'Symfony\Component\Form\FormTypeInterface'); } $this->types[$type->getName()] = $type; } } /** * Initializes the type extensions. * * @throws UnexpectedTypeException if any registered type extension is not * an instance of FormTypeExtensionInterface */ private function initTypeExtensions() { $this->typeExtensions = array(); foreach ($this->loadTypeExtensions() as $extension) { if (!$extension instanceof FormTypeExtensionInterface) { throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormTypeExtensionInterface'); } $type = $extension->getExtendedType(); $this->typeExtensions[$type][] = $extension; } } /** * Initializes the type guesser. * * @throws UnexpectedTypeException if the type guesser is not an instance of FormTypeGuesserInterface */ private function initTypeGuesser() { $this->typeGuesserLoaded = true; $this->typeGuesser = $this->loadTypeGuesser(); if (null !== $this->typeGuesser && !$this->typeGuesser instanceof FormTypeGuesserInterface) { throw new UnexpectedTypeException($this->typeGuesser, 'Symfony\Component\Form\FormTypeGuesserInterface'); } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
Exception
---
0755
Extension
---
0755
Guess
---
0755
Resources
---
0755
Test
---
0755
Util
---
0755
AbstractExtension.php
4885 bytes
0644
AbstractRendererEngine.php
7634 bytes
0644
AbstractType.php
1080 bytes
0644
AbstractTypeExtension.php
993 bytes
0644
Button.php
8826 bytes
0644
ButtonBuilder.php
18523 bytes
0644
ButtonTypeInterface.php
462 bytes
0644
CallbackTransformer.php
2138 bytes
0644
ClickableInterface.php
559 bytes
0644
DataMapperInterface.php
1130 bytes
0644
DataTransformerInterface.php
3159 bytes
0644
Form.php
34865 bytes
0644
FormBuilder.php
7871 bytes
0644
FormBuilderInterface.php
2335 bytes
0644
FormConfigBuilder.php
21680 bytes
0644
FormConfigBuilderInterface.php
8666 bytes
0644
FormConfigInterface.php
6437 bytes
0644
FormError.php
2563 bytes
0644
FormEvent.php
1247 bytes
0644
FormEvents.php
1140 bytes
0644
FormExtensionInterface.php
1668 bytes
0644
FormFactory.php
5225 bytes
0644
FormFactoryBuilder.php
3609 bytes
0644
FormFactoryBuilderInterface.php
3058 bytes
0644
FormFactoryInterface.php
4244 bytes
0644
FormInterface.php
8328 bytes
0644
FormRegistry.php
4753 bytes
0644
FormRegistryInterface.php
1442 bytes
0644
FormRenderer.php
11954 bytes
0644
FormRendererEngineInterface.php
7063 bytes
0644
FormRendererInterface.php
3279 bytes
0644
FormTypeExtensionInterface.php
2125 bytes
0644
FormTypeGuesserChain.php
2880 bytes
0644
FormTypeGuesserInterface.php
2170 bytes
0644
FormTypeInterface.php
3222 bytes
0644
FormView.php
3524 bytes
0644
Forms.php
5899 bytes
0644
NativeRequestHandler.php
5612 bytes
0644
PreloadedExtension.php
2317 bytes
0644
RequestHandlerInterface.php
668 bytes
0644
ResolvedFormType.php
7662 bytes
0644
ResolvedFormTypeFactory.php
658 bytes
0644
ResolvedFormTypeFactoryInterface.php
1302 bytes
0644
ResolvedFormTypeInterface.php
3307 bytes
0644
ReversedTransformer.php
1256 bytes
0644
SubmitButton.php
1137 bytes
0644
SubmitButtonBuilder.php
624 bytes
0644
SubmitButtonTypeInterface.php
474 bytes
0644
autoloader.php
334 bytes
0644
N4ST4R_ID | Naxtarrr