سلام، من دیدم که هربار با اجرای کدها تعداد فایلها زیاد میشن برای همین توی متد export یه سری تغییرات اعمال کردم شاید به کار شماهم بیاد :
public function export()
{
$file_name = "text-file" . $this->format;
$file_path = __DIR__ . "/files/$file_name";
if (file_exists($file_path)) {
unlink($file_path);
}
file_put_contents($file_path, "{$this->data['title']}\\n{$this->data['content']}");
echo "$file_name Successfully Created!\\n"
}