$36 GRAYBYTE WORDPRESS FILE MANAGER $59

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

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

HOME
Current File : /opt/alt/php53/usr/share/pear/Symfony/Component/Config/Definition//EnumNode.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * 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;

/**
 * Node which only allows a finite set of values.
 *
 * @author Johannes M. Schmitt <[email protected]>
 */
class EnumNode extends ScalarNode
{
    private $values;

    public function __construct($name, NodeInterface $parent = null, array $values = array())
    {
        $values = array_unique($values);
        if (count($values) <= 1) {
            throw new \InvalidArgumentException('$values must contain at least two distinct elements.');
        }

        parent::__construct($name, $parent);
        $this->values = $values;
    }

    public function getValues()
    {
        return $this->values;
    }

    protected function finalizeValue($value)
    {
        $value = parent::finalizeValue($value);

        if (!in_array($value, $this->values, true)) {
            $ex = new InvalidConfigurationException(sprintf(
                'The value %s is not allowed for path "%s". Permissible values: %s',
                json_encode($value),
                $this->getPath(),
                implode(', ', array_map('json_encode', $this->values))));
            $ex->setPath($this->getPath());

            throw $ex;
        }

        return $value;
    }
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


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

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF