1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 18:28:25 +01:00
PHP-Parser/lib/PHPParser/Node/Stmt/Interface.php

23 lines
851 B
PHP

<?php
/**
* @property string $name Name
* @property array $extends Extended interfaces
* @property array $stmts Statements
*/
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));
}
}
}
}