file = $file; } protected $file; function getContents(bool $close=true): string { if ($this->file === null) return parent::getContents(); try { return file_get_contents($this->file); } finally { $this->close($close); } } }