$45 GRAYBYTE WORDPRESS FILE MANAGER $59

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php53/usr/share/pear/Symfony/Component/Config/Definition/

HOME
Current File : /opt/alt/php53/usr/share/pear/Symfony/Component/Config/Definition//VariableNode.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\Config\Definition;

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

/**
 * This node represents a value of variable type in the config tree.
 *
 * This node is intended for values of arbitrary type.
 * Any PHP type is accepted as a value.
 *
 * @author Jeremy Mikola <jmikola@gmail.com>
 */
class VariableNode extends BaseNode implements PrototypeNodeInterface
{
    protected $defaultValueSet = false;
    protected $defaultValue;
    protected $allowEmptyValue = true;

    /**
     * {@inheritDoc}
     */
    public function setDefaultValue($value)
    {
        $this->defaultValueSet = true;
        $this->defaultValue = $value;
    }

    /**
     * {@inheritDoc}
     */
    public function hasDefaultValue()
    {
        return $this->defaultValueSet;
    }

    /**
     * {@inheritDoc}
     */
    public function getDefaultValue()
    {
        return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue;
    }

    /**
     * Sets if this node is allowed to have an empty value.
     *
     * @param Boolean $boolean True if this entity will accept empty values.
     */
    public function setAllowEmptyValue($boolean)
    {
        $this->allowEmptyValue = (Boolean) $boolean;
    }

    /**
     * {@inheritDoc}
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * {@inheritDoc}
     */
    protected function validateType($value)
    {
    }

    /**
     * {@inheritDoc}
     */
    protected function finalizeValue($value)
    {
        if (!$this->allowEmptyValue && empty($value)) {
            $ex = new InvalidConfigurationException(sprintf(
                'The path "%s" cannot contain an empty value, but got %s.',
                $this->getPath(),
                json_encode($value)
            ));
            $ex->setPath($this->getPath());

            throw $ex;
        }

        return $value;
    }

    /**
     * {@inheritDoc}
     */
    protected function normalizeValue($value)
    {
        return $value;
    }

    /**
     * {@inheritDoc}
     */
    protected function mergeValues($leftSide, $rightSide)
    {
        return $rightSide;
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 7.05 AM
root / root
0755
Builder
--
31 Aug 2024 7.05 AM
root / root
0755
Dumper
--
31 Aug 2024 7.05 AM
root / root
0755
Exception
--
31 Aug 2024 7.05 AM
root / root
0755
ArrayNode.php
10.726 KB
18 Dec 2019 6.20 PM
root / root
0644
BaseNode.php
8.506 KB
18 Dec 2019 6.20 PM
root / root
0644
BooleanNode.php
0.917 KB
18 Dec 2019 6.20 PM
root / root
0644
ConfigurationInterface.php
0.598 KB
18 Dec 2019 6.20 PM
root / root
0644
EnumNode.php
1.512 KB
18 Dec 2019 6.20 PM
root / root
0644
FloatNode.php
0.985 KB
18 Dec 2019 6.20 PM
root / root
0644
IntegerNode.php
0.854 KB
18 Dec 2019 6.20 PM
root / root
0644
NodeInterface.php
1.884 KB
18 Dec 2019 6.20 PM
root / root
0644
NumericNode.php
1.544 KB
18 Dec 2019 6.20 PM
root / root
0644
Processor.php
2.788 KB
18 Dec 2019 6.20 PM
root / root
0644
PrototypeNodeInterface.php
0.616 KB
18 Dec 2019 6.20 PM
root / root
0644
PrototypedArrayNode.php
9.784 KB
18 Dec 2019 6.20 PM
root / root
0644
ReferenceDumper.php
0.547 KB
18 Dec 2019 6.20 PM
root / root
0644
ScalarNode.php
1.058 KB
18 Dec 2019 6.20 PM
root / root
0644
VariableNode.php
2.43 KB
18 Dec 2019 6.20 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF