@@ -98,7 +98,7 @@ |
||
| 98 | 98 | /** |
| 99 | 99 | * Clears user session. |
| 100 | 100 | * |
| 101 | - * @return static |
|
| 101 | + * @return \Psr\Http\Message\ResponseInterface |
|
| 102 | 102 | */ |
| 103 | 103 | public function logout() : \Psr\Http\Message\ResponseInterface |
| 104 | 104 | { |
@@ -32,7 +32,6 @@ |
||
| 32 | 32 | /** |
| 33 | 33 | * Invoked on middleware execution. |
| 34 | 34 | * |
| 35 | - * @param mixed $exception exception |
|
| 36 | 35 | * @param Request $request request |
| 37 | 36 | * @param Response $response response |
| 38 | 37 | * @return HtmlResponse |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | * Update or Insert user. |
| 107 | 107 | * |
| 108 | 108 | * @param Array $data Data from POST |
| 109 | - * @param null $userId UUID of user if we want to edit or 0 to add new user |
|
| 109 | + * @param integer $userId UUID of user if we want to edit or 0 to add new user |
|
| 110 | 110 | * @throws \Exception |
| 111 | 111 | */ |
| 112 | 112 | public function save($data, $userId = 0) |
@@ -114,15 +114,13 @@ |
||
| 114 | 114 | //@todo Validate data |
| 115 | 115 | if($data['password'] == ''){ |
| 116 | 116 | unset($data['password']); |
| 117 | - } |
|
| 118 | - else{ |
|
| 117 | + } else{ |
|
| 119 | 118 | $data['password'] = $this->crypt->create($data['password']); |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 | if($userId){ |
| 123 | 122 | $this->adminUsersMapper->update($data, ['admin_user_uuid' => $userId]); |
| 124 | - } |
|
| 125 | - else{ |
|
| 123 | + } else{ |
|
| 126 | 124 | $data['admin_user_uuid'] = Uuid::uuid1()->toString(); |
| 127 | 125 | $this->adminUsersMapper->insert($data); |
| 128 | 126 | } |
@@ -99,8 +99,7 @@ discard block |
||
| 99 | 99 | $this->adminUserService->save($data, $userId); |
| 100 | 100 | |
| 101 | 101 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 102 | - } |
|
| 103 | - catch(\Exception $e){ |
|
| 102 | + } catch(\Exception $e){ |
|
| 104 | 103 | return $this->response->withStatus(302)->withHeader( |
| 105 | 104 | 'Location', |
| 106 | 105 | $this->router->generateUri('admin.users.action', ['action' => 'edit', 'id' => $userId]) |
@@ -115,8 +114,7 @@ discard block |
||
| 115 | 114 | $this->adminUserService->delete($userId); |
| 116 | 115 | |
| 117 | 116 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 118 | - } |
|
| 119 | - catch(\Exception $e){ |
|
| 117 | + } catch(\Exception $e){ |
|
| 120 | 118 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 121 | 119 | } |
| 122 | 120 | } |