1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2025-01-22 22:01:18 +01:00
PHP-Parser/lib/PHPParser/NodeAbstract.php

39 lines
823 B
PHP
Raw Normal View History

2011-04-18 19:02:30 +02:00
<?php
abstract class PHPParser_NodeAbstract extends ArrayObject
2011-04-18 19:02:30 +02:00
{
protected $line;
2011-04-18 19:02:30 +02:00
/**
* Creates a Node.
*
* @param array $subNodes Array of sub nodes
* @param int $line Line
*/
public function __construct(array $subNodes, $line = -1) {
parent::__construct($subNodes, ArrayObject::ARRAY_AS_PROPS);
$this->line = $line;
2011-05-30 22:11:11 +02:00
}
/**
* Gets the type of this node.
*
* The type of a node is the node's class name without the
2011-06-05 18:40:04 +02:00
* PHPParser_Node_ prefix.
*
* @return string Type of this node
*/
public function getType() {
2011-06-05 18:40:04 +02:00
return substr(get_class($this), 15);
}
/**
2011-06-28 14:11:12 +02:00
* Gets line the node started in.
*
* @return int Line
*/
public function getLine() {
return $this->line;
}
2011-04-18 19:02:30 +02:00
}