@@ -83,7 +83,7 @@ |
||
83 | 83 | private function setUserDataById(int $usersId): void |
84 | 84 | { |
85 | 85 | |
86 | - $hostUser = Users::findFirst([ |
|
86 | + $hostUser = Users::findFirst([ |
|
87 | 87 | 'conditions'=> 'id = ?0 and status = 1 and is_deleted = 0', |
88 | 88 | 'bind'=>[$usersId] |
89 | 89 | ]); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | public function getById($id) : Response |
76 | 76 | { |
77 | 77 | //none admin users can only edit themselves |
78 | - if (!$this->userData->hasRole('Default.Admins') || (int) $id === 0) { |
|
78 | + if (!$this->userData->hasRole('Default.Admins') || (int)$id === 0) { |
|
79 | 79 | $id = $this->userData->getId(); |
80 | 80 | } |
81 | 81 |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $createFields = ['name', 'address','email','zipcode','phone', 'is_default']; |
|
27 | + protected $createFields = ['name', 'address', 'email', 'zipcode', 'phone', 'is_default']; |
|
28 | 28 | |
29 | 29 | /* |
30 | 30 | * fields we accept to create |
31 | 31 | * |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - protected $updateFields = ['name', 'address','email','zipcode','phone', 'is_default']; |
|
34 | + protected $updateFields = ['name', 'address', 'email', 'zipcode', 'phone', 'is_default']; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * set objects |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return $this->response($this->model->toArray()); |
107 | 107 | } else { |
108 | 108 | $this->db->rollback(); |
109 | - throw new UnprocessableEntityHttpException((string) $this->model->getMessages()[0]); |
|
109 | + throw new UnprocessableEntityHttpException((string)$this->model->getMessages()[0]); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | return $this->response($company); |
138 | 138 | } else { |
139 | 139 | //didnt work |
140 | - throw new UnprocessableEntityHttpException((string) current($company->getMessages())); |
|
140 | + throw new UnprocessableEntityHttpException((string)current($company->getMessages())); |
|
141 | 141 | } |
142 | 142 | } else { |
143 | 143 | throw new UnprocessableEntityHttpException('Record not found'); |
@@ -119,7 +119,7 @@ |
||
119 | 119 | */ |
120 | 120 | public function detachDevice(int $id, int $deviceId): Response |
121 | 121 | { |
122 | - //$sourceId = $this->request->getPost('source_id', 'int'); |
|
122 | + //$sourceId = $this->request->getPost('source_id', 'int'); |
|
123 | 123 | $userSource = UserLinkedSources::findFirst([ |
124 | 124 | 'conditions' => 'users_id = ?0 and source_users_id_text = ?1 and is_deleted = 0', |
125 | 125 | 'bind' => [$this->userData->getId(), $deviceId] |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $userSource->is_deleted = 0; |
95 | 95 | |
96 | 96 | if (!$userSource->save()) { |
97 | - throw new UnprocessableEntityHttpException((string) current($userSource->getMessages())); |
|
97 | + throw new UnprocessableEntityHttpException((string)current($userSource->getMessages())); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $msg = 'User Device Associated'; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | $userInvite->created_at = date('Y-m-d H:m:s'); |
132 | 132 | |
133 | 133 | if (!$userInvite->save()) { |
134 | - throw new UnprocessableEntityHttpException((string) current($userInvite->getMessages())); |
|
134 | + throw new UnprocessableEntityHttpException((string)current($userInvite->getMessages())); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $this->sendInviteEmail($request['email'], $userInvite->invite_hash); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $messages = $validation->validate($this->request->getPost()); |
81 | 81 | if (count($messages)) { |
82 | 82 | foreach ($messages as $message) { |
83 | - throw new UnprocessableEntityHttpException((string) $message); |
|
83 | + throw new UnprocessableEntityHttpException((string)$message); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $companyApp->subscriptions_id = $subscription->getId(); |
206 | 206 | if (!$companyApp->update()) { |
207 | 207 | $this->db->rollback(); |
208 | - throw new UnprocessableEntityHttpException((string) current($companyApp->getMessages())); |
|
208 | + throw new UnprocessableEntityHttpException((string)current($companyApp->getMessages())); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | //update the subscription with the plan |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if (!$subscription->update()) { |
214 | 214 | $this->db->rollback(); |
215 | 215 | |
216 | - throw new UnprocessableEntityHttpException((string) current($subscription->getMessages())); |
|
216 | + throw new UnprocessableEntityHttpException((string)current($subscription->getMessages())); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $messages = $validation->validate($this->request->getPut()); |
278 | 278 | if (count($messages)) { |
279 | 279 | foreach ($messages as $message) { |
280 | - throw new UnprocessableEntityHttpException((string) $message); |
|
280 | + throw new UnprocessableEntityHttpException((string)$message); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 |
@@ -69,12 +69,12 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * Set the email config array we are going to be sending |
|
73 | - * |
|
74 | - * @param String $emailAction |
|
75 | - * @param Users $user |
|
76 | - * @return void |
|
77 | - */ |
|
72 | + * Set the email config array we are going to be sending |
|
73 | + * |
|
74 | + * @param String $emailAction |
|
75 | + * @param Users $user |
|
76 | + * @return void |
|
77 | + */ |
|
78 | 78 | protected function sendEmail(BakaUsers $user, string $type): void |
79 | 79 | { |
80 | 80 | $send = true; |
@@ -104,16 +104,16 @@ |
||
104 | 104 | return $record; |
105 | 105 | } |
106 | 106 | |
107 | - /** |
|
108 | - * Format output. |
|
109 | - * |
|
110 | - * @param [type] $results |
|
111 | - * @return void |
|
112 | - */ |
|
107 | + /** |
|
108 | + * Format output. |
|
109 | + * |
|
110 | + * @param [type] $results |
|
111 | + * @return void |
|
112 | + */ |
|
113 | 113 | protected function processOutput($results) |
114 | 114 | { |
115 | 115 | |
116 | - //add a mapper |
|
116 | + //add a mapper |
|
117 | 117 | $this->dtoConfig->registerMapping(CustomFilters::class, CustomFilterDto::class) |
118 | 118 | ->useCustomMapper(new CustomFilterMapper()); |
119 | 119 |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function edit($id) : Response |
151 | 151 | { |
152 | - if (!$role = Roles::getById((int) $id)) { |
|
152 | + if (!$role = Roles::getById((int)$id)) { |
|
153 | 153 | throw new NotFoundHttpException('Record not found'); |
154 | 154 | } |
155 | 155 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $role->name = $request['roles']['name']; |
180 | 180 | $role->description = $request['roles']['description']; |
181 | 181 | if (!$role->update()) { |
182 | - throw new ServerErrorHttpException((string) current($role->getMessages())); |
|
182 | + throw new ServerErrorHttpException((string)current($role->getMessages())); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | //clean previous records |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function copy($id) : Response |
206 | 206 | { |
207 | - if (!$role = Roles::getById((int) $id)) { |
|
207 | + if (!$role = Roles::getById((int)$id)) { |
|
208 | 208 | throw new NotFoundHttpException('Record not found'); |
209 | 209 | } |
210 | 210 |