php-parser/lib/PHPParser/Node/Stmt/Interface.php

23 lines
851 B
PHP
Raw Normal View History

<?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
{
public function __construct(array $subNodes, $line = -1, $docComment = null) {
parent::__construct($subNodes, $line, $docComment);
if ('self' == $this->name || 'parent' == $this->name) { // 'static' cannot occur
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 || 'static' == $interface) {
throw new PHPParser_Error(sprintf('Cannot use "%s" as interface name as it is reserved', $interface));
}
}
}
}