summaryrefslogtreecommitdiff
path: root/app/Model/File.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-17 10:09:03 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-17 10:09:03 -0400
commit8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec (patch)
tree289222e21420b8d0092f06de097090f179202f6b /app/Model/File.php
parentb40190ee9fd557d86e594208ed77fa762c7dcfb7 (diff)
Run php-cs-fixer on the code base
Diffstat (limited to 'app/Model/File.php')
-rw-r--r--app/Model/File.php15
1 files changed, 3 insertions, 12 deletions
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;
}