From 8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 17 Oct 2015 10:09:03 -0400 Subject: Run php-cs-fixer on the code base --- app/Model/File.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'app/Model/File.php') diff --git a/app/Model/File.php b/app/Model/File.php index e4430217..daade517 100644 --- a/app/Model/File.php +++ b/app/Model/File.php @@ -50,7 +50,6 @@ class File extends Base public function remove($file_id) { try { - $file = $this->getbyId($file_id); $this->objectStorage->remove($file['path']); @@ -59,8 +58,7 @@ class File extends Base } return $this->db->table(self::TABLE)->eq('id', $file['id'])->remove(); - } - catch (ObjectStorageException $e) { + } catch (ObjectStorageException $e) { $this->logger->error($e->getMessage()); return false; } @@ -108,7 +106,6 @@ class File extends Base )); if ($result) { - $this->container['dispatcher']->dispatch( self::EVENT_CREATE, new FileEvent(array('task_id' => $task_id, 'name' => $name)) @@ -266,15 +263,12 @@ class File extends Base public function uploadFiles($project_id, $task_id, $form_name) { try { - if (empty($_FILES[$form_name])) { return false; } foreach ($_FILES[$form_name]['error'] as $key => $error) { - if ($error == UPLOAD_ERR_OK && $_FILES[$form_name]['size'][$key] > 0) { - $original_filename = $_FILES[$form_name]['name'][$key]; $uploaded_filename = $_FILES[$form_name]['tmp_name'][$key]; $destination_filename = $this->generatePath($project_id, $task_id, $original_filename); @@ -295,8 +289,7 @@ class File extends Base } return true; - } - catch (ObjectStorageException $e) { + } catch (ObjectStorageException $e) { $this->logger->error($e->getMessage()); return false; } @@ -330,7 +323,6 @@ class File extends Base public function uploadContent($project_id, $task_id, $original_filename, $blob) { try { - $data = base64_decode($blob); if (empty($data)) { @@ -350,8 +342,7 @@ class File extends Base $destination_filename, strlen($data) ); - } - catch (ObjectStorageException $e) { + } catch (ObjectStorageException $e) { $this->logger->error($e->getMessage()); return false; } -- cgit v1.2.3