$92 GRAYBYTE WORDPRESS FILE MANAGER $84

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/php54/usr/share/pear/Symfony/Component/Config/Definition/

HOME
Current File : /opt/alt/php54/usr/share/pear/Symfony/Component/Config/Definition//NumericNode.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 numeric value in the config tree
 *
 * @author David Jeanmonod <david.jeanmonod@gmail.com>
 */
class NumericNode extends ScalarNode
{
    protected $min;
    protected $max;

    public function __construct($name, NodeInterface $parent = null, $min = null, $max = null)
    {
        parent::__construct($name, $parent);
        $this->min = $min;
        $this->max = $max;
    }

    /**
     * {@inheritDoc}
     */
    protected function finalizeValue($value)
    {
        $value = parent::finalizeValue($value);

        $errorMsg = null;
        if (isset($this->min) && $value < $this->min) {
            $errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than or equal to %s', $value, $this->getPath(), $this->min);
        }
        if (isset($this->max) && $value > $this->max) {
            $errorMsg = sprintf('The value %s is too big for path "%s". Should be less than or equal to %s', $value, $this->getPath(), $this->max);
        }
        if (isset($errorMsg)) {
            $ex = new InvalidConfigurationException($errorMsg);
            $ex->setPath($this->getPath());
            throw $ex;
        }

        return $value;
    }
}

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.22 PM
root / root
0644
BaseNode.php
8.506 KB
18 Dec 2019 6.22 PM
root / root
0644
BooleanNode.php
0.917 KB
18 Dec 2019 6.22 PM
root / root
0644
ConfigurationInterface.php
0.598 KB
18 Dec 2019 6.22 PM
root / root
0644
EnumNode.php
1.512 KB
18 Dec 2019 6.22 PM
root / root
0644
FloatNode.php
0.985 KB
18 Dec 2019 6.22 PM
root / root
0644
IntegerNode.php
0.854 KB
18 Dec 2019 6.22 PM
root / root
0644
NodeInterface.php
1.884 KB
18 Dec 2019 6.22 PM
root / root
0644
NumericNode.php
1.544 KB
18 Dec 2019 6.22 PM
root / root
0644
Processor.php
2.788 KB
18 Dec 2019 6.22 PM
root / root
0644
PrototypeNodeInterface.php
0.616 KB
18 Dec 2019 6.22 PM
root / root
0644
PrototypedArrayNode.php
9.784 KB
18 Dec 2019 6.22 PM
root / root
0644
ReferenceDumper.php
0.547 KB
18 Dec 2019 6.22 PM
root / root
0644
ScalarNode.php
1.058 KB
18 Dec 2019 6.22 PM
root / root
0644
VariableNode.php
2.43 KB
18 Dec 2019 6.22 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF