path = $path; $this->contents = $contents; $this->flags = (int) $flags; } public function onRun(){ try{ file_put_contents($this->path, $this->contents, (int) $this->flags); }catch (\Exception $e){ } } }