@@ -50,16 +50,16 @@ |
||
| 50 | 50 | public function expireCredentials() { |
| 51 | 51 | $this->logger->info('Passman cron test', array('app' => 'passman')); |
| 52 | 52 | $expired_credentials = $this->credentialService->getExpiredCredentials($this->utils->getTime()); |
| 53 | - foreach($expired_credentials as $credential){ |
|
| 53 | + foreach ($expired_credentials as $credential) { |
|
| 54 | 54 | $link = ''; // @TODO create direct link to credential |
| 55 | 55 | |
| 56 | 56 | $sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?'; |
| 57 | 57 | $id = $credential->getId(); |
| 58 | 58 | $result = $this->db->executeQuery($sql, array($id)); |
| 59 | - $this->logger->debug($credential->getLabel() .' is expired, checking notifications!', array('app' => 'passman')); |
|
| 59 | + $this->logger->debug($credential->getLabel() . ' is expired, checking notifications!', array('app' => 'passman')); |
|
| 60 | 60 | $notifications = intval($result->fetch()['rows']); |
| 61 | - if($notifications === 0) { |
|
| 62 | - $this->logger->debug($credential->getLabel() .' is expired, adding notification!', array('app' => 'passman')); |
|
| 61 | + if ($notifications === 0) { |
|
| 62 | + $this->logger->debug($credential->getLabel() . ' is expired, adding notification!', array('app' => 'passman')); |
|
| 63 | 63 | $this->activityService->add( |
| 64 | 64 | Activity::SUBJECT_ITEM_EXPIRED, array($credential->getLabel(), $credential->getUserId()), |
| 65 | 65 | '', array(), |
@@ -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 | } |