mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-05-07 05:45:20 +02:00
added implementations for the new interface methods
This commit is contained in:
parent
e932711fa4
commit
2ccae143d0
@ -5,6 +5,7 @@ abstract class PHPParser_NodeAbstract implements PHPParser_Node, IteratorAggrega
|
|||||||
protected $subNodes;
|
protected $subNodes;
|
||||||
protected $line;
|
protected $line;
|
||||||
protected $docComment;
|
protected $docComment;
|
||||||
|
protected $attributes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Node.
|
* Creates a Node.
|
||||||
@ -17,6 +18,7 @@ abstract class PHPParser_NodeAbstract implements PHPParser_Node, IteratorAggrega
|
|||||||
$this->subNodes = $subNodes;
|
$this->subNodes = $subNodes;
|
||||||
$this->line = $line;
|
$this->line = $line;
|
||||||
$this->docComment = $docComment;
|
$this->docComment = $docComment;
|
||||||
|
$this->attributes = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +75,34 @@ abstract class PHPParser_NodeAbstract implements PHPParser_Node, IteratorAggrega
|
|||||||
$this->docComment = $docComment;
|
$this->docComment = $docComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function setAttribute($key, $value) {
|
||||||
|
$this->attributes[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function hasAttribute($key) {
|
||||||
|
return array_key_exists($key, $this->attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getAttribute($key, $default = null) {
|
||||||
|
return array_key_exists($key, $this->attributes) ? $this->attributes[$key] : $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getAttributes() {
|
||||||
|
return $this->attributes;
|
||||||
|
}
|
||||||
|
|
||||||
/* Magic interfaces */
|
/* Magic interfaces */
|
||||||
|
|
||||||
public function &__get($name) {
|
public function &__get($name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user