public function appendFiles($files) { if (is_string($files)) { $this->files = array_merge($this->files, [$files]); } else { if (is_array($files)) { $this->files = array_merge($this->files, $files); } else { throw new Exception(); } } return $this; }