vendor/symfony/src/Symfony/Component/Config/Definition/NodeInterface.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Component\Config\Definition;
       
    13 
       
    14 /**
       
    15  * Common Interface among all nodes.
       
    16  *
       
    17  * In most cases, it is better to inherit from BaseNode instead of implementing
       
    18  * this interface yourself.
       
    19  *
       
    20  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
       
    21  */
       
    22 interface NodeInterface
       
    23 {
       
    24     /**
       
    25      * Returns the name of the node.
       
    26      *
       
    27      * @return string The name of the node
       
    28      */
       
    29     function getName();
       
    30 
       
    31     /**
       
    32      * Returns the path of the node.
       
    33      *
       
    34      * @return string The node path
       
    35      */
       
    36     function getPath();
       
    37 
       
    38     /**
       
    39      * Returns true when the node is required.
       
    40      *
       
    41      * @return Boolean If the node is required
       
    42      */
       
    43     function isRequired();
       
    44 
       
    45     /**
       
    46      * Returns true when the node has a default value.
       
    47      *
       
    48      * @return Boolean If the node has a default value
       
    49      */
       
    50     function hasDefaultValue();
       
    51 
       
    52     /**
       
    53      * Returns the default value of the node.
       
    54      *
       
    55      * @return mixed The default value
       
    56      * @throws \RuntimeException if the node has no default value
       
    57      */
       
    58     function getDefaultValue();
       
    59 
       
    60     /**
       
    61      * Normalizes the supplied value.
       
    62      *
       
    63      * @param mixed $value The value to normalize
       
    64      * @return mixed The normalized value
       
    65      */
       
    66     function normalize($value);
       
    67 
       
    68     /**
       
    69      * Merges two values together.
       
    70      *
       
    71      * @param mixed $leftSide
       
    72      * @param mixed $rightSide
       
    73      * @return mixed The merged values
       
    74      */
       
    75     function merge($leftSide, $rightSide);
       
    76 
       
    77     /**
       
    78      * Finalizes a value.
       
    79      *
       
    80      * @param mixed $value The value to finalize
       
    81      * @return mixed The finalized value
       
    82      */
       
    83     function finalize($value);
       
    84 }