@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | $status = $object->disabled; |
14 | 14 | |
15 | - $object->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
15 | + $object->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
16 | 16 | $object->save(); |
17 | 17 | } |
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -31,7 +31,7 @@ |
||
31 | 31 | [['text' => __('Name')], ['text' => $widget->getLocaleName()]], |
32 | 32 | [['text' => __('System name')], ['text' => $widget->sys_name]], |
33 | 33 | [['text' => __('Last update')], ['text' => Date::convertToDatetime($widget->updated_at, DATE::FORMAT_TO_SECONDS)]], |
34 | - [['text' => __('Status')], ['text' => ((int)$widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int)$widget->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
34 | + [['text' => __('Status')], ['text' => ((int) $widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int) $widget->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
35 | 35 | ] |
36 | 36 | ] |
37 | 37 | ]); ?> |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $search = \Apps\ActiveRecord\App::getItem('app', $controller); |
72 | 72 | |
73 | 73 | // check what we got |
74 | - if ($search === null || (int)$search->id < 1) { |
|
74 | + if ($search === null || (int) $search->id < 1) { |
|
75 | 75 | throw new ForbiddenException('App is not founded'); |
76 | 76 | } |
77 | 77 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first(); |
98 | 98 | |
99 | - if ($search === null || (int)$search->id < 1) { |
|
99 | + if ($search === null || (int) $search->id < 1) { |
|
100 | 100 | throw new ForbiddenException('App is not founded'); |
101 | 101 | } |
102 | 102 |
@@ -9,4 +9,4 @@ |
||
9 | 9 | ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']], |
10 | 10 | ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']] |
11 | 11 | ] |
12 | -]);?> |
|
13 | 12 | \ No newline at end of file |
13 | +]); ?> |
|
14 | 14 | \ No newline at end of file |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function __construct($recordPost, $userId = 0) |
30 | 30 | { |
31 | 31 | $this->_post = $recordPost; |
32 | - $this->_userId = (int)$userId; |
|
32 | + $this->_userId = (int) $userId; |
|
33 | 33 | parent::__construct(); |
34 | 34 | } |
35 | 35 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function __construct($captcha = true) |
22 | 22 | { |
23 | - $this->_useCaptcha = (bool)$captcha; |
|
23 | + $this->_useCaptcha = (bool) $captcha; |
|
24 | 24 | parent::__construct(); |
25 | 25 | } |
26 | 26 |
@@ -9,4 +9,4 @@ |
||
9 | 9 | ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']], |
10 | 10 | ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']] |
11 | 11 | ] |
12 | -]);?> |
|
13 | 12 | \ No newline at end of file |
13 | +]); ?> |
|
14 | 14 | \ No newline at end of file |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $answerTime = Date::convertToTimestamp($lastAnswer->created_at); |
150 | 150 | $cfgs = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
151 | 151 | // hmm, maybe past less then delay required? |
152 | - if ($now - (int)$cfgs['delayBetweenPost'] < $answerTime) { |
|
152 | + if ($now - (int) $cfgs['delayBetweenPost'] < $answerTime) { |
|
153 | 153 | throw new JsonException('Delay between answers not pass'); |
154 | 154 | } |
155 | 155 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $postInfo = $findAnswer->getWallPost(); |
197 | 197 | |
198 | 198 | // if not a target user of answer and not answer owner - lets throw exception |
199 | - if($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
199 | + if ($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
200 | 200 | throw new JsonException('Access declined!'); |
201 | 201 | } |
202 | 202 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | // sender is not myself? then i'm - target (remote user is sender user->to_me) |
257 | 257 | if ($row->sender_id !== $user->id) { |
258 | 258 | $userList[] = $row->sender_id; |
259 | - if ((int)$row->tread === 0) { |
|
259 | + if ((int) $row->tread === 0) { |
|
260 | 260 | $unreadList[] = $row->sender_id; |
261 | 261 | } |
262 | 262 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | // get special types for this action |
326 | 326 | $queryType = App::$Request->get('type'); |
327 | - $queryId = (int)App::$Request->get('id'); |
|
327 | + $queryId = (int) App::$Request->get('id'); |
|
328 | 328 | // get current user object |
329 | 329 | $user = App::$User->identity(); |
330 | 330 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | switch ($queryType) { |
341 | 341 | case 'after': |
342 | 342 | $messages = Message::where('id', '>', $queryId) |
343 | - ->where(function ($query) use ($cor_id, $user) { |
|
344 | - $query->where(function ($q) use ($cor_id, $user){ |
|
343 | + ->where(function($query) use ($cor_id, $user) { |
|
344 | + $query->where(function($q) use ($cor_id, $user){ |
|
345 | 345 | $q->where('target_id', '=', $user->getId()) |
346 | 346 | ->where('sender_id', '=', $cor_id); |
347 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
347 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
348 | 348 | $q->where('target_id', '=', $cor_id) |
349 | 349 | ->where('sender_id', '=', $user->getId()); |
350 | 350 | }); |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | break; |
353 | 353 | case 'before': |
354 | 354 | $messages = Message::where('id', '<', $queryId) |
355 | - ->where(function ($query) use ($cor_id, $user) { |
|
356 | - $query->where(function ($q) use ($cor_id, $user){ |
|
355 | + ->where(function($query) use ($cor_id, $user) { |
|
356 | + $query->where(function($q) use ($cor_id, $user){ |
|
357 | 357 | $q->where('target_id', '=', $user->getId()) |
358 | 358 | ->where('sender_id', '=', $cor_id); |
359 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
359 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
360 | 360 | $q->where('target_id', '=', $cor_id) |
361 | 361 | ->where('sender_id', '=', $user->getId()); |
362 | 362 | }); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $this->setJsonHeader(); |
456 | 456 | |
457 | 457 | // get operation type and target user id |
458 | - $target_id = (int)App::$Request->get('target'); |
|
458 | + $target_id = (int) App::$Request->get('target'); |
|
459 | 459 | $type = App::$Request->get('type'); |
460 | 460 | |
461 | 461 | // check type of query |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | $cfg = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
472 | 472 | // check if rating is enabled for website |
473 | - if ((int)$cfg['rating'] !== 1) { |
|
473 | + if ((int) $cfg['rating'] !== 1) { |
|
474 | 474 | throw new JsonException('Rating is disabled'); |
475 | 475 | } |
476 | 476 |
@@ -32,8 +32,8 @@ |
||
32 | 32 | foreach ($records as $item) { |
33 | 33 | $message = Str::sub(\App::$Security->strip_tags($item->message), 0, 50); |
34 | 34 | $author = Simplify::parseUserNick($item->user_id, $item->guest_name); |
35 | - if ((int)$item->user_id > 0) { |
|
36 | - $author = Url::link(['user/update', (int)$item->user_id], $author); |
|
35 | + if ((int) $item->user_id > 0) { |
|
36 | + $author = Url::link(['user/update', (int) $item->user_id], $author); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 |