@@ -103,17 +103,14 @@ discard block |
||
103 | 103 | |
104 | 104 | if($userId) { |
105 | 105 | $this->adminUserService->updateUser($data, $userId); |
106 | - } |
|
107 | - else { |
|
106 | + } else { |
|
108 | 107 | $this->adminUserService->registerNewUser($data); |
109 | 108 | } |
110 | 109 | |
111 | 110 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
112 | - } |
|
113 | - catch(FilterException $fe) { |
|
111 | + } catch(FilterException $fe) { |
|
114 | 112 | return $this->edit($fe->getArrayMessages()); |
115 | - } |
|
116 | - catch(\Exception $e) { |
|
113 | + } catch(\Exception $e) { |
|
117 | 114 | throw $e; |
118 | 115 | } |
119 | 116 | } |
@@ -125,8 +122,7 @@ discard block |
||
125 | 122 | $this->adminUserService->delete($userId); |
126 | 123 | |
127 | 124 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
128 | - } |
|
129 | - catch(\Exception $e) { |
|
125 | + } catch(\Exception $e) { |
|
130 | 126 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
131 | 127 | } |
132 | 128 | } |
@@ -35,16 +35,13 @@ |
||
35 | 35 | { |
36 | 36 | if($menuItem['href']) { |
37 | 37 | return strpos($menuItem['href'], 'http') === 0 ? $menuItem['href'] : '/' . $menuItem['href']; |
38 | - } |
|
39 | - elseif($menuItem['article_slug']) { |
|
38 | + } elseif($menuItem['article_slug']) { |
|
40 | 39 | $params = ['segment_1' => $menuItem['category_slug'], 'segment_2' => $menuItem['article_slug']]; |
41 | 40 | |
42 | 41 | return $this->url->__invoke('post', $params); |
43 | - } |
|
44 | - elseif($menuItem['category_slug']) { |
|
42 | + } elseif($menuItem['category_slug']) { |
|
45 | 43 | return $this->url->__invoke('category', ['category' => $menuItem['category_slug']]); |
46 | - } |
|
47 | - else { |
|
44 | + } else { |
|
48 | 45 | return '#'; |
49 | 46 | } |
50 | 47 | } |
@@ -25,8 +25,7 @@ |
||
25 | 25 | $this->newsletterService->registerNew($email); |
26 | 26 | |
27 | 27 | return new JsonResponse(['message' => 'Uspešno ste se prijavili.']); |
28 | - } |
|
29 | - catch(\Exception $e) { |
|
28 | + } catch(\Exception $e) { |
|
30 | 29 | return new JsonResponse(['message' => $e->getMessage()], $e->getCode()); |
31 | 30 | } |
32 | 31 | } |