Permalink
Browse files

added some methods for storing metadata to the interface

  • Loading branch information...
1 parent 77d58a4 commit e932711fa4ae9b8265b18b0a5da41df8717d5583 @schmittjoh committed Apr 3, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 lib/PHPParser/Node.php
View
@@ -43,4 +43,38 @@ public function getDocComment();
* @param null|string $docComment Nearest doc comment or null
*/
public function setDocComment($docComment);
+
+ /**
+ * Sets an attribute on a node.
+ *
+ * @param string $key
+ * @param mixed $value
+ */
+ public function setAttribute($key, $value);
+
+ /**
+ * Returns whether an attribute exists.
+ *
+ * @param string $key
+ *
+ * @return Boolean
+ */
+ public function hasAttribute($key);
+
+ /**
+ * Returns the value of an attribute.
+ *
+ * @param string $key
+ * @param mixed $default
+ *
+ * @return mixed
+ */
+ public function getAttribute($key, $default = null);
+
+ /**
+ * Returns all attributes for the given node.
+ *
+ * @return array
+ */
+ public function getAttributes();
}

0 comments on commit e932711

Please sign in to comment.