Passed
Push — master ( 069627...087cc0 )
by Mihail
03:55
created
Apps/Controller/Api/Profile.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Apps/Controller/Console/Db.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Apps/View/Front/default/profile/show.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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">
Please login to merge, or discard this patch.
Apps/Controller/Api/Comments.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
         // set header
21 21
         $this->setJsonHeader();
22 22
         // offset can be only integer
23
-        $offset = (int)$offset;
23
+        $offset = (int) $offset;
24 24
         // get comment target path and check
25
-        $path = (string)App::$Request->query->get('path');
25
+        $path = (string) App::$Request->query->get('path');
26 26
         if (Str::likeEmpty($path)) {
27 27
             throw new JsonException('Wrong path');
28 28
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function actionShowanswers($commentId)
76 76
     {
77 77
         // check input data
78
-        if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) {
78
+        if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) {
79 79
             throw new JsonException('Input data is incorrect');
80 80
         }
81 81
 
Please login to merge, or discard this patch.
Apps/View/Install/default/main/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 ]);
55 55
 ?>
56 56
 
57
-<?php if($model->checkAll()): ?>
57
+<?php if ($model->checkAll()): ?>
58 58
     <?= \Ffcms\Core\Helper\Url::link('main/install', __('Start install'), ['class' => 'btn btn-success btn-block']) ?>
59 59
 <?php else: ?>
60 60
     <?= \Ffcms\Core\Helper\Url::link('main/index', __('Check again'), ['class' => 'btn btn-warning btn-block']) ?>
Please login to merge, or discard this patch.
Private/Config/Object.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 date_default_timezone_set('Europe/Moscow');
12 12
 
13 13
 return [
14
-    'Database' => function () {
14
+    'Database' => function() {
15 15
         $capsule = new Capsule;
16 16
         if (env_name !== 'Install') {
17 17
             try {
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
         return new Session($storage);
47 47
     },
48
-    'User' => function () {
48
+    'User' => function() {
49 49
         return new Apps\ActiveRecord\User();
50 50
     },
51
-    'Mailer' => function () {
51
+    'Mailer' => function() {
52 52
         $swiftTransport = Swift_MailTransport::newInstance();
53 53
         return Swift_Mailer::newInstance($swiftTransport);
54 54
     },
55
-    'Captcha' => function () {
55
+    'Captcha' => function() {
56 56
         return new Extend\Core\Captcha\Gregwar();
57 57
     },
58
-    'Cache' => function () {
58
+    'Cache' => function() {
59 59
         phpFastCache::setup('path', root . '/Private/Cache');
60 60
         return \phpFastCache();
61 61
     }
Please login to merge, or discard this patch.
Private/Database/Tables/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 Illuminate\Database\Capsule\Manager::schema($connectName)->create('sessions', function($table) {
4
-    $table->string('sess_id', 128)->index()->primary()  ;
4
+    $table->string('sess_id', 128)->index()->primary();
5 5
     $table->binary('sess_data');
6 6
     $table->string('sess_lifetime', 16); // shutout to laravel, if i make it like "integer" it automaticlly add "primary" key for it, hate this!!!
7 7
     $table->string('sess_time', 16);
Please login to merge, or discard this patch.
Widgets/Basic/LanguageSwitcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         foreach (App::$Translate->getAvailableLangs() as $lang) {
27 27
             $items[] = [
28 28
                 'type' => 'text',
29
-                'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" />',
29
+                'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" />',
30 30
                 'html' => true,
31 31
                 '!secure' => true
32 32
             ];
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityCategoryRead.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         ];
58 58
 
59 59
         // check if this category is hidden
60
-        if ((int)$this->categoryData['configs']['showCategory'] !== 1) {
60
+        if ((int) $this->categoryData['configs']['showCategory'] !== 1) {
61 61
             throw new ForbiddenException();
62 62
         }
63 63
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 // find first paragraph ending
83 83
                 $breakPosition = mb_strpos($text, '</p>', null, 'UTF-8');
84 84
                 // cut text from position caret before </p> (+4 symbols to save item as valid)
85
-                $text = Str::sub($text, 0, $breakPosition+4);
85
+                $text = Str::sub($text, 0, $breakPosition + 4);
86 86
             }
87 87
 
88 88
             $itemPath = $this->_allCategories[$row->category_id]['path'];
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
                 'author' => $owner,
136 136
                 'poster' => $poster,
137 137
                 'thumb' => $thumb,
138
-                'views' => (int)$row->views,
139
-                'rating' => (int)$row->rating,
138
+                'views' => (int) $row->views,
139
+                'rating' => (int) $row->rating,
140 140
                 'category' => $this->_allCategories[$row->category_id],
141 141
                 'uri' => '/content/read/' . $itemPath,
142 142
                 'tags' => $tags
Please login to merge, or discard this patch.