refactor(FileStream): ensure resource is closed in destructor

Added a destructor to close the resource when the object is destroyed.
This commit is contained in:
Jérémy Munsch 2026-11-03 15:53:12 +01:00
parent 08fda2cdfd
commit f658df0c7b
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4

View file

@ -89,4 +89,9 @@ final readonly class FileStream
fclose($this->resource);
}
}
public function __destruct()
{
$this->close();
}
}