filename = $filename; $this->filesize = filesize($filename); $this->type = $type; } /** * Enable getting values for keys in the response * * @param string $key * @return mixed|object * @throws \Exception */ public function __get(string $key): mixed { switch ($key) { case 'type': return $this->type; default: throw new \Exception('Unknown key: '.$key); } } }