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;
15 * Common Interface among all nodes.
17 * In most cases, it is better to inherit from BaseNode instead of implementing
18 * this interface yourself.
20 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
22 interface NodeInterface
25 * Returns the name of the node.
27 * @return string The name of the node
29 public function getName();
32 * Returns the path of the node.
34 * @return string The node path
36 public function getPath();
39 * Returns true when the node is required.
41 * @return bool If the node is required
43 public function isRequired();
46 * Returns true when the node has a default value.
48 * @return bool If the node has a default value
50 public function hasDefaultValue();
53 * Returns the default value of the node.
55 * @return mixed The default value
57 * @throws \RuntimeException if the node has no default value
59 public function getDefaultValue();
62 * Normalizes the supplied value.
64 * @param mixed $value The value to normalize
66 * @return mixed The normalized value
68 public function normalize($value);
71 * Merges two values together.
73 * @param mixed $leftSide
74 * @param mixed $rightSide
76 * @return mixed The merged values
78 public function merge($leftSide, $rightSide);
83 * @param mixed $value The value to finalize
85 * @return mixed The finalized value
87 public function finalize($value);