composer package updates
[openemr.git] / vendor / symfony / config / Definition / NodeInterface.php
blob45f1f681c1ea58cde3327a9eb2b36974c8ebd966
1 <?php
3 /*
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Definition;
14 use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
15 use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
16 use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
18 /**
19 * Common Interface among all nodes.
21 * In most cases, it is better to inherit from BaseNode instead of implementing
22 * this interface yourself.
24 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
26 interface NodeInterface
28 /**
29 * Returns the name of the node.
31 * @return string The name of the node
33 public function getName();
35 /**
36 * Returns the path of the node.
38 * @return string The node path
40 public function getPath();
42 /**
43 * Returns true when the node is required.
45 * @return bool If the node is required
47 public function isRequired();
49 /**
50 * Returns true when the node has a default value.
52 * @return bool If the node has a default value
54 public function hasDefaultValue();
56 /**
57 * Returns the default value of the node.
59 * @return mixed The default value
61 * @throws \RuntimeException if the node has no default value
63 public function getDefaultValue();
65 /**
66 * Normalizes a value.
68 * @param mixed $value The value to normalize
70 * @return mixed The normalized value
72 * @throws InvalidTypeException if the value type is invalid
74 public function normalize($value);
76 /**
77 * Merges two values together.
79 * @param mixed $leftSide
80 * @param mixed $rightSide
82 * @return mixed The merged value
84 * @throws ForbiddenOverwriteException if the configuration path cannot be overwritten
85 * @throws InvalidTypeException if the value type is invalid
87 public function merge($leftSide, $rightSide);
89 /**
90 * Finalizes a value.
92 * @param mixed $value The value to finalize
94 * @return mixed The finalized value
96 * @throws InvalidTypeException if the value type is invalid
97 * @throws InvalidConfigurationException if the value is invalid configuration
99 public function finalize($value);