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)
/**
* Sets the parent node.
*
- * @param NodeParentInterface $parent The parent
- *
* @return $this
*/
public function setParent(NodeParentInterface $parent)
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.
*