PhpParser\Node\Stmt\Class_::__construct PHP Method

__construct() public method

Constructs a class node.
public __construct ( string | null $name, array $subNodes = [], array $attributes = [] )
$name string | null Name
$subNodes array Array of the following optional subnodes: 'flags' => 0 : Flags 'extends' => null : Name of extended class 'implements' => array(): Names of implemented interfaces 'stmts' => array(): Statements
$attributes array Additional attributes
    public function __construct($name, array $subNodes = array(), array $attributes = array())
    {
        parent::__construct($attributes);
        $this->flags = isset($subNodes['flags']) ? $subNodes['flags'] : (isset($subNodes['type']) ? $subNodes['type'] : 0);
        $this->type = $this->flags;
        $this->name = $name;
        $this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : null;
        $this->implements = isset($subNodes['implements']) ? $subNodes['implements'] : array();
        $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
    }