__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?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\Builder;
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
/**
* Abstract class that contains common code of integer and float node definitions.
*
* @author David Jeanmonod <david.jeanmonod@gmail.com>
*/
abstract class NumericNodeDefinition extends ScalarNodeDefinition
{
protected $min;
protected $max;
/**
* Ensures that the value is smaller than the given reference.
*
* @return $this
*
* @throws \InvalidArgumentException when the constraint is inconsistent
*/
public function max(int|float $max): static
{
if (isset($this->min) && $this->min > $max) {
throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s).', $max, $this->min));
}
$this->max = $max;
return $this;
}
/**
* Ensures that the value is bigger than the given reference.
*
* @return $this
*
* @throws \InvalidArgumentException when the constraint is inconsistent
*/
public function min(int|float $min): static
{
if (isset($this->max) && $this->max < $min) {
throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s).', $min, $this->max));
}
$this->min = $min;
return $this;
}
/**
* @throws InvalidDefinitionException
*/
public function cannotBeEmpty(): static
{
throw new InvalidDefinitionException('->cannotBeEmpty() is not applicable to NumericNodeDefinition.');
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| ArrayNodeDefinition.php | File | 15.67 KB | 0644 |
|
| BooleanNodeDefinition.php | File | 1.18 KB | 0644 |
|
| BuilderAwareInterface.php | File | 606 B | 0644 |
|
| EnumNodeDefinition.php | File | 1.16 KB | 0644 |
|
| ExprBuilder.php | File | 5.57 KB | 0644 |
|
| FloatNodeDefinition.php | File | 753 B | 0644 |
|
| IntegerNodeDefinition.php | File | 764 B | 0644 |
|
| MergeBuilder.php | File | 1.2 KB | 0644 |
|
| NodeBuilder.php | File | 5.04 KB | 0644 |
|
| NodeDefinition.php | File | 7.84 KB | 0644 |
|
| NodeParentInterface.php | File | 447 B | 0644 |
|
| NormalizationBuilder.php | File | 1.46 KB | 0644 |
|
| NumericNodeDefinition.php | File | 1.83 KB | 0644 |
|
| ParentNodeDefinitionInterface.php | File | 1.14 KB | 0644 |
|
| ScalarNodeDefinition.php | File | 726 B | 0644 |
|
| TreeBuilder.php | File | 1.54 KB | 0644 |
|
| ValidationBuilder.php | File | 986 B | 0644 |
|
| VariableNodeDefinition.php | File | 1.81 KB | 0644 |
|