- $this->flags = isset($subNodes['flags']) ? $subNodes['flags']
- : (isset($subNodes['type']) ? $subNodes['type'] : 0);
- $this->type = $this->flags;
- $this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
- $this->name = $name;
- $this->params = isset($subNodes['params']) ? $subNodes['params'] : array();
- $this->returnType = isset($subNodes['returnType']) ? $subNodes['returnType'] : null;
- $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : array();
+ $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
+ $this->byRef = $subNodes['byRef'] ?? false;
+ $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
+ $this->params = $subNodes['params'] ?? [];
+ $returnType = $subNodes['returnType'] ?? null;
+ $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
+ $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : [];