public function toArray() : array
    {
        if($this->data !== null) {
            return $this->data;
        }

        if ($this->type == 'spreadsheet') {
            $this->data = $this->parseDataFromSpreadsheet($this->buffer, $this->extension);

        } else {
            $this->data = $this->parseDataFromArray($this->buffer);
        }

        return $this->data;
    }