[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.133.153.110: ~ $
<?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\AlreadySubmittedException;
use Symfony\Component\Form\Exception\BadMethodCallException;

/**
 * A form button.
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class Button implements \IteratorAggregate, FormInterface
{
    /**
     * @var FormInterface
     */
    private $parent;

    /**
     * @var FormConfigInterface
     */
    private $config;

    /**
     * @var bool
     */
    private $submitted = false;

    /**
     * Creates a new button from a form configuration.
     */
    public function __construct(FormConfigInterface $config)
    {
        $this->config = $config;
    }

    /**
     * Unsupported method.
     *
     * @param mixed $offset
     *
     * @return bool Always returns false
     */
    public function offsetExists($offset)
    {
        return false;
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param mixed $offset
     *
     * @throws BadMethodCallException
     */
    public function offsetGet($offset)
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param mixed $offset
     * @param mixed $value
     *
     * @throws BadMethodCallException
     */
    public function offsetSet($offset, $value)
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param mixed $offset
     *
     * @throws BadMethodCallException
     */
    public function offsetUnset($offset)
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * {@inheritdoc}
     */
    public function setParent(FormInterface $parent = null)
    {
        if ($this->submitted) {
            throw new AlreadySubmittedException('You cannot set the parent of a submitted button.');
        }

        $this->parent = $parent;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @throws BadMethodCallException
     */
    public function add($child, $type = null, array $options = [])
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param string $name
     *
     * @throws BadMethodCallException
     */
    public function get($name)
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * Unsupported method.
     *
     * @param string $name
     *
     * @return bool Always returns false
     */
    public function has($name)
    {
        return false;
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param string $name
     *
     * @throws BadMethodCallException
     */
    public function remove($name)
    {
        throw new BadMethodCallException('Buttons cannot have children.');
    }

    /**
     * {@inheritdoc}
     */
    public function all()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public function getErrors($deep = false, $flatten = true)
    {
        return new FormErrorIterator($this, []);
    }

    /**
     * Unsupported method.
     *
     * This method should not be invoked.
     *
     * @param mixed $modelData
     *
     * @return $this
     */
    public function setData($modelData)
    {
        // no-op, called during initialization of the form tree
        return $this;
    }

    /**
     * Unsupported method.
     */
    public function getData()
    {
        return null;
    }

    /**
     * Unsupported method.
     */
    public function getNormData()
    {
        return null;
    }

    /**
     * Unsupported method.
     */
    public function getViewData()
    {
        return null;
    }

    /**
     * Unsupported method.
     *
     * @return array Always returns an empty array
     */
    public function getExtraData()
    {
        return [];
    }

    /**
     * Returns the button's configuration.
     *
     * @return FormConfigInterface The configuration instance
     */
    public function getConfig()
    {
        return $this->config;
    }

    /**
     * Returns whether the button is submitted.
     *
     * @return bool true if the button was submitted
     */
    public function isSubmitted()
    {
        return $this->submitted;
    }

    /**
     * Returns the name by which the button is identified in forms.
     *
     * @return string The name of the button
     */
    public function getName()
    {
        return $this->config->getName();
    }

    /**
     * Unsupported method.
     */
    public function getPropertyPath()
    {
        return null;
    }

    /**
     * Unsupported method.
     *
     * @throws BadMethodCallException
     */
    public function addError(FormError $error)
    {
        throw new BadMethodCallException('Buttons cannot have errors.');
    }

    /**
     * Unsupported method.
     *
     * @return bool Always returns true
     */
    public function isValid()
    {
        return true;
    }

    /**
     * Unsupported method.
     *
     * @return bool Always returns false
     */
    public function isRequired()
    {
        return false;
    }

    /**
     * {@inheritdoc}
     */
    public function isDisabled()
    {
        if ($this->parent && $this->parent->isDisabled()) {
            return true;
        }

        return $this->config->getDisabled();
    }

    /**
     * Unsupported method.
     *
     * @return bool Always returns true
     */
    public function isEmpty()
    {
        return true;
    }

    /**
     * Unsupported method.
     *
     * @return bool Always returns true
     */
    public function isSynchronized()
    {
        return true;
    }

    /**
     * Unsupported method.
     */
    public function getTransformationFailure()
    {
        return null;
    }

    /**
     * Unsupported method.
     *
     * @throws BadMethodCallException
     */
    public function initialize()
    {
        throw new BadMethodCallException('Buttons cannot be initialized. Call initialize() on the root form instead.');
    }

    /**
     * Unsupported method.
     *
     * @param mixed $request
     *
     * @throws BadMethodCallException
     */
    public function handleRequest($request = null)
    {
        throw new BadMethodCallException('Buttons cannot handle requests. Call handleRequest() on the root form instead.');
    }

    /**
     * Submits data to the button.
     *
     * @param string|null $submittedData Not used
     * @param bool        $clearMissing  Not used
     *
     * @return $this
     *
     * @throws Exception\AlreadySubmittedException if the button has already been submitted
     */
    public function submit($submittedData, $clearMissing = true)
    {
        if ($this->submitted) {
            throw new AlreadySubmittedException('A form can only be submitted once.');
        }

        $this->submitted = true;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getRoot()
    {
        return $this->parent ? $this->parent->getRoot() : $this;
    }

    /**
     * {@inheritdoc}
     */
    public function isRoot()
    {
        return null === $this->parent;
    }

    /**
     * {@inheritdoc}
     */
    public function createView(FormView $parent = null)
    {
        if (null === $parent && $this->parent) {
            $parent = $this->parent->createView();
        }

        $type = $this->config->getType();
        $options = $this->config->getOptions();

        $view = $type->createView($this, $parent);

        $type->buildView($view, $this, $options);
        $type->finishView($view, $this, $options);

        return $view;
    }

    /**
     * Unsupported method.
     *
     * @return int Always returns 0
     */
    public function count()
    {
        return 0;
    }

    /**
     * Unsupported method.
     *
     * @return \EmptyIterator Always returns an empty iterator
     */
    public function getIterator()
    {
        return new \EmptyIterator();
    }
}

Filemanager

Name Type Size Permission Actions
ChoiceList Folder 0755
Command Folder 0755
Console Folder 0755
DependencyInjection Folder 0755
Exception Folder 0755
Extension Folder 0755
Guess Folder 0755
Resources Folder 0755
Test Folder 0755
Tests Folder 0755
Util Folder 0755
.gitignore File 34 B 0644
AbstractExtension.php File 4.77 KB 0644
AbstractRendererEngine.php File 7.46 KB 0644
AbstractType.php File 1.28 KB 0644
AbstractTypeExtension.php File 974 B 0644
Button.php File 8.53 KB 0644
ButtonBuilder.php File 16.51 KB 0644
ButtonTypeInterface.php File 462 B 0644
CHANGELOG.md File 18.51 KB 0644
CallbackTransformer.php File 1.02 KB 0644
ClickableInterface.php File 555 B 0644
DataMapperInterface.php File 2.34 KB 0644
DataTransformerInterface.php File 3.79 KB 0644
Form.php File 36.09 KB 0644
FormBuilder.php File 7.28 KB 0644
FormBuilderInterface.php File 1.97 KB 0644
FormConfigBuilder.php File 19.33 KB 0644
FormConfigBuilderInterface.php File 8.03 KB 0644
FormConfigInterface.php File 6.65 KB 0644
FormError.php File 4.14 KB 0644
FormErrorIterator.php File 7.62 KB 0644
FormEvent.php File 1.18 KB 0644
FormEvents.php File 3.29 KB 0644
FormExtensionInterface.php File 1.62 KB 0644
FormFactory.php File 4.17 KB 0644
FormFactoryBuilder.php File 4.17 KB 0644
FormFactoryBuilderInterface.php File 2.31 KB 0644
FormFactoryInterface.php File 3.94 KB 0644
FormInterface.php File 10.02 KB 0644
FormRegistry.php File 5.07 KB 0644
FormRegistryInterface.php File 1.32 KB 0644
FormRenderer.php File 11.55 KB 0644
FormRendererEngineInterface.php File 6.48 KB 0644
FormRendererInterface.php File 3.41 KB 0644
FormTypeExtensionInterface.php File 1.62 KB 0644
FormTypeGuesserChain.php File 2.88 KB 0644
FormTypeGuesserInterface.php File 2.14 KB 0644
FormTypeInterface.php File 3.07 KB 0644
FormView.php File 3.51 KB 0644
Forms.php File 3.76 KB 0644
LICENSE File 1.04 KB 0644
NativeRequestHandler.php File 7.53 KB 0644
PreloadedExtension.php File 2.18 KB 0644
README.md File 488 B 0644
RequestHandlerInterface.php File 860 B 0644
ResolvedFormType.php File 6.75 KB 0644
ResolvedFormTypeFactory.php File 658 B 0644
ResolvedFormTypeFactoryInterface.php File 1.17 KB 0644
ResolvedFormTypeInterface.php File 3.26 KB 0644
ReversedTransformer.php File 1.03 KB 0644
SubmitButton.php File 1.2 KB 0644
SubmitButtonBuilder.php File 624 B 0644
SubmitButtonTypeInterface.php File 474 B 0644
composer.json File 2.05 KB 0644
phpunit.xml.dist File 882 B 0644