Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / config / Definition / Builder / NodeDefinition.php
index 1b712a3150bc3dee1f53b2276059b753816f2ba7..7dcfd5164d86e9178e9404cf43fdf5b3cf4ae7ef 100644 (file)
@@ -27,22 +27,17 @@ abstract class NodeDefinition implements NodeParentInterface
     protected $defaultValue;
     protected $default = false;
     protected $required = false;
+    protected $deprecationMessage = null;
     protected $merge;
     protected $allowEmptyValue = true;
     protected $nullEquivalent;
     protected $trueEquivalent = true;
     protected $falseEquivalent = false;
-
-    /**
-     * @var NodeParentInterface|null
-     */
     protected $parent;
     protected $attributes = array();
 
     /**
-     * Constructor.
-     *
-     * @param string                   $name   The name of the node
+     * @param string|null              $name   The name of the node
      * @param NodeParentInterface|null $parent The parent
      */
     public function __construct($name, NodeParentInterface $parent = null)
@@ -54,8 +49,6 @@ abstract class NodeDefinition implements NodeParentInterface
     /**
      * Sets the parent node.
      *
-     * @param NodeParentInterface $parent The parent
-     *
      * @return $this
      */
     public function setParent(NodeParentInterface $parent)
@@ -168,6 +161,23 @@ abstract class NodeDefinition implements NodeParentInterface
         return $this;
     }
 
+    /**
+     * Sets the node as deprecated.
+     *
+     * You can use %node% and %path% placeholders in your message to display,
+     * respectively, the node name and its complete path.
+     *
+     * @param string $message Deprecation message
+     *
+     * @return $this
+     */
+    public function setDeprecated($message = 'The child node "%node%" at path "%path%" is deprecated.')
+    {
+        $this->deprecationMessage = $message;
+
+        return $this;
+    }
+
     /**
      * Sets the equivalent value used when the node contains null.
      *