@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct($AppName, |
| 24 | 24 | IRequest $request, |
| 25 | 25 | $UserId, |
| 26 | - FileService $fileService){ |
|
| 26 | + FileService $fileService) { |
|
| 27 | 27 | parent::__construct($AppName, $request); |
| 28 | 28 | $this->userId = $UserId; |
| 29 | 29 | $this->fileService = $fileService; |
@@ -59,20 +59,20 @@ discard block |
||
| 59 | 59 | return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId)); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function updateFile($file_id, $file_data, $filename){ |
|
| 63 | - try{ |
|
| 62 | + public function updateFile($file_id, $file_data, $filename) { |
|
| 63 | + try { |
|
| 64 | 64 | $file = $this->fileService->getFile($file_id, $this->userId); |
| 65 | - } catch (\Exception $doesNotExistException){ |
|
| 65 | + } catch (\Exception $doesNotExistException) { |
|
| 66 | 66 | |
| 67 | 67 | } |
| 68 | - if($file){ |
|
| 69 | - if($file_data) { |
|
| 68 | + if ($file) { |
|
| 69 | + if ($file_data) { |
|
| 70 | 70 | $file->setFileData($file_data); |
| 71 | 71 | } |
| 72 | - if($filename) { |
|
| 72 | + if ($filename) { |
|
| 73 | 73 | $file->setFilename($filename); |
| 74 | 74 | } |
| 75 | - if($filename || $file_data){ |
|
| 75 | + if ($filename || $file_data) { |
|
| 76 | 76 | new JSONResponse($this->fileService->updateFile($file)); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct($AppName, |
| 24 | 24 | IRequest $request, |
| 25 | 25 | $UserId, |
| 26 | - FileService $fileService){ |
|
| 26 | + FileService $fileService) { |
|
| 27 | 27 | parent::__construct($AppName, $request); |
| 28 | 28 | $this->userId = $UserId; |
| 29 | 29 | $this->fileService = $fileService; |
@@ -59,20 +59,20 @@ discard block |
||
| 59 | 59 | return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId)); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function updateFile($file_id, $file_data, $filename){ |
|
| 62 | + public function updateFile($file_id, $file_data, $filename) { |
|
| 63 | 63 | try{ |
| 64 | 64 | $file = $this->fileService->getFile($file_id, $this->userId); |
| 65 | 65 | } catch (\Exception $doesNotExistException){ |
| 66 | 66 | |
| 67 | 67 | } |
| 68 | - if($file){ |
|
| 68 | + if($file) { |
|
| 69 | 69 | if($file_data) { |
| 70 | 70 | $file->setFileData($file_data); |
| 71 | 71 | } |
| 72 | 72 | if($filename) { |
| 73 | 73 | $file->setFilename($filename); |
| 74 | 74 | } |
| 75 | - if($filename || $file_data){ |
|
| 75 | + if($filename || $file_data) { |
|
| 76 | 76 | new JSONResponse($this->fileService->updateFile($file)); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function remind($credential_id) { |
| 42 | 42 | $credential = $this->credentialService->getCredentialById($credential_id, $this->userId); |
| 43 | - if($credential) { |
|
| 43 | + if ($credential) { |
|
| 44 | 44 | $credential->setExpireTime(time() + (24 * 60 * 60)); |
| 45 | 45 | $this->credentialService->upd($credential); |
| 46 | 46 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function read($credential_id) { |
| 60 | 60 | |
| 61 | 61 | $credential = $this->credentialService->getCredentialById($credential_id, $this->userId); |
| 62 | - if($credential) { |
|
| 62 | + if ($credential) { |
|
| 63 | 63 | $credential->setExpireTime(0); |
| 64 | 64 | $this->credentialService->upd($credential); |
| 65 | 65 | |