@@ -28,7 +28,7 @@ |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | // if widget is disabled - lets return nothing |
31 | - if ((int)$wData->disabled === 1) { |
|
31 | + if ((int) $wData->disabled === 1) { |
|
32 | 32 | return null; |
33 | 33 | } |
34 | 34 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 0 => 'global/write', |
5 | 5 | 1 => 'global/modify', |
6 | 6 | 2 => 'global/file', |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $query = new UserRecords(); |
27 | 27 | |
28 | 28 | // set current page and offset |
29 | - $page = (int)App::$Request->query->get('page'); |
|
29 | + $page = (int) App::$Request->query->get('page'); |
|
30 | 30 | $offset = $page * self::ITEM_PER_PAGE; |
31 | 31 | |
32 | 32 | // build pagination |
@@ -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 |
@@ -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 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $cfg['database'] = $this->db; |
71 | 71 | $cfg['adminEmail'] = $this->email; |
72 | 72 | $cfg['singleLanguage'] = $this->singleLanguage; |
73 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
73 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
74 | 74 | $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
75 | 75 | $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
76 | 76 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $answerTime = Date::convertToTimestamp($lastAnswer->created_at); |
148 | 148 | $cfgs = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
149 | 149 | // hmm, maybe past less then delay required? |
150 | - if ($now - (int)$cfgs['delayBetweenPost'] < $answerTime) { |
|
150 | + if ($now - (int) $cfgs['delayBetweenPost'] < $answerTime) { |
|
151 | 151 | throw new JsonException('Delay between answers not pass'); |
152 | 152 | } |
153 | 153 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $postInfo = $findAnswer->getWallPost(); |
195 | 195 | |
196 | 196 | // if not a target user of answer and not answer owner - lets throw exception |
197 | - if($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
197 | + if ($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
198 | 198 | throw new JsonException('Access declined!'); |
199 | 199 | } |
200 | 200 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | // sender is not myself? then i'm - target (remote user is sender user->to_me) |
255 | 255 | if ($row->sender_id !== $user->id) { |
256 | 256 | $userList[] = $row->sender_id; |
257 | - if ((int)$row->tread === 0) { |
|
257 | + if ((int) $row->tread === 0) { |
|
258 | 258 | $unreadList[] = $row->sender_id; |
259 | 259 | } |
260 | 260 | } |
@@ -272,8 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $response[] = [ |
274 | 274 | 'user_id' => $user_id, |
275 | - 'user_nick' => $identity->getProfile()->nick === null ? 'id' . $identity->getId() : |
|
276 | - App::$Security->strip_tags($identity->getProfile()->nick), |
|
275 | + 'user_nick' => $identity->getProfile()->nick === null ? 'id' . $identity->getId() : App::$Security->strip_tags($identity->getProfile()->nick), |
|
277 | 276 | 'user_avatar' => $identity->getProfile()->getAvatarUrl('small'), |
278 | 277 | 'message_new' => Arr::in($user_id, $unreadList), |
279 | 278 | 'user_block' => !Blacklist::check($user->id, $identity->id) |
@@ -323,7 +322,7 @@ discard block |
||
323 | 322 | |
324 | 323 | // get special types for this action |
325 | 324 | $queryType = App::$Request->get('type'); |
326 | - $queryId = (int)App::$Request->get('id'); |
|
325 | + $queryId = (int) App::$Request->get('id'); |
|
327 | 326 | // get current user object |
328 | 327 | $user = App::$User->identity(); |
329 | 328 | |
@@ -339,11 +338,11 @@ discard block |
||
339 | 338 | switch ($queryType) { |
340 | 339 | case 'after': |
341 | 340 | $messages = Message::where('id', '>', $queryId) |
342 | - ->where(function ($query) use ($cor_id, $user) { |
|
343 | - $query->where(function ($q) use ($cor_id, $user){ |
|
341 | + ->where(function($query) use ($cor_id, $user) { |
|
342 | + $query->where(function($q) use ($cor_id, $user){ |
|
344 | 343 | $q->where('target_id', '=', $user->getId()) |
345 | 344 | ->where('sender_id', '=', $cor_id); |
346 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
345 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
347 | 346 | $q->where('target_id', '=', $cor_id) |
348 | 347 | ->where('sender_id', '=', $user->getId()); |
349 | 348 | }); |
@@ -351,11 +350,11 @@ discard block |
||
351 | 350 | break; |
352 | 351 | case 'before': |
353 | 352 | $messages = Message::where('id', '<', $queryId) |
354 | - ->where(function ($query) use ($cor_id, $user) { |
|
355 | - $query->where(function ($q) use ($cor_id, $user){ |
|
353 | + ->where(function($query) use ($cor_id, $user) { |
|
354 | + $query->where(function($q) use ($cor_id, $user){ |
|
356 | 355 | $q->where('target_id', '=', $user->getId()) |
357 | 356 | ->where('sender_id', '=', $cor_id); |
358 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
357 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
359 | 358 | $q->where('target_id', '=', $cor_id) |
360 | 359 | ->where('sender_id', '=', $user->getId()); |
361 | 360 | }); |
@@ -454,7 +453,7 @@ discard block |
||
454 | 453 | $this->setJsonHeader(); |
455 | 454 | |
456 | 455 | // get operation type and target user id |
457 | - $target_id = (int)App::$Request->get('target'); |
|
456 | + $target_id = (int) App::$Request->get('target'); |
|
458 | 457 | $type = App::$Request->get('type'); |
459 | 458 | |
460 | 459 | // check type of query |
@@ -469,7 +468,7 @@ discard block |
||
469 | 468 | |
470 | 469 | $cfg = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
471 | 470 | // check if rating is enabled for website |
472 | - if ((int)$cfg['rating'] !== 1) { |
|
471 | + if ((int) $cfg['rating'] !== 1) { |
|
473 | 472 | throw new JsonException('Rating is disabled'); |
474 | 473 | } |
475 | 474 |
@@ -52,8 +52,8 @@ |
||
52 | 52 | throw new NativeException('Password is bad'); |
53 | 53 | } |
54 | 54 | echo "RoleId (1 = user, 3 = admin):"; |
55 | - $role = (int)App::$Input->read(); |
|
56 | - if (!Arr::in($role, [1,2,3])) { |
|
55 | + $role = (int) App::$Input->read(); |
|
56 | + if (!Arr::in($role, [1, 2, 3])) { |
|
57 | 57 | $role = 1; |
58 | 58 | } |
59 | 59 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | <?php |
45 | 45 | if ($ratingOn): |
46 | 46 | $rateClass = 'btn-default'; |
47 | - $rateValue = (int)$user->getProfile()->rating; |
|
47 | + $rateValue = (int) $user->getProfile()->rating; |
|
48 | 48 | if ($user->getProfile()->rating > 0) { |
49 | 49 | $rateClass = 'btn-info'; |
50 | 50 | } elseif ($user->getProfile()->rating < 0) { |
@@ -226,8 +226,7 @@ discard block |
||
226 | 226 | continue; |
227 | 227 | } |
228 | 228 | $referNickname = ($referObject->getProfile()->nick == null ? |
229 | - __('No name') . ' <sup>id' . $referObject->getId() . '</sup>' : |
|
230 | - \App::$Security->strip_tags($referObject->getProfile()->nick)); |
|
229 | + __('No name') . ' <sup>id' . $referObject->getId() . '</sup>' : \App::$Security->strip_tags($referObject->getProfile()->nick)); |
|
231 | 230 | ?> |
232 | 231 | <div class="row object-lightborder" id="wall-post-<?= $post->id ?>"> |
233 | 232 | <div class="col-md-2"> |