parseString($head); } /** * Parse demo info from a local file. * * @throws InvalidArgumentException */ public function parseHeader(string $path): Header { if (!is_readable($path)) { throw new InvalidArgumentException('Unable to open demo: ' . $path); } $fh = fopen($path, 'r'); return $this->parseStream($fh); } }