- $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();
+ $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
+ $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
+ $this->extends = $subNodes['extends'] ?? null;
+ $this->implements = $subNodes['implements'] ?? [];
+ $this->stmts = $subNodes['stmts'] ?? [];