2011-05-27 18:20:44 +02:00
|
|
|
<?php
|
|
|
|
|
2011-05-30 17:29:10 +02:00
|
|
|
/**
|
|
|
|
* @property string $name Name
|
|
|
|
* @property array $extends Extended interfaces
|
|
|
|
* @property array $stmts Statements
|
|
|
|
*/
|
2011-06-05 18:40:04 +02:00
|
|
|
class PHPParser_Node_Stmt_Interface extends PHPParser_Node_Stmt
|
2011-05-27 18:20:44 +02:00
|
|
|
{
|
2011-08-04 12:03:34 +02:00
|
|
|
public function __construct(array $subNodes, $line = -1, $docComment = null) {
|
|
|
|
parent::__construct($subNodes, $line, $docComment);
|
|
|
|
|
|
|
|
if ('self' == $this->name || 'parent' == $this->name) {
|
|
|
|
throw new PHPParser_Error(sprintf('Cannot use "%s" as class name as it is reserved', $this->name));
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($this->extends as $interface) {
|
|
|
|
if ('self' == $interface || 'parent' == $interface) {
|
|
|
|
throw new PHPParser_Error(sprintf('Cannot use "%s" as interface name as it is reserved', $interface));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-05-27 18:20:44 +02:00
|
|
|
}
|