Test Failed
Push — master ( 4aac7f...6a48a0 )
by Mihail
06:45
created
Apps/Model/Admin/Content/FormCategoryUpdate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function __construct(ContentCategory $record, $dependId = null)
37 37
     {
38 38
         $this->_record = $record;
39
-        $this->_tmpDependId = (int)$dependId;
39
+        $this->_tmpDependId = (int) $dependId;
40 40
         parent::__construct();
41 41
     }
42 42
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         ];
114 114
 
115 115
         // general category
116
-        if (!$this->_new && (int)$this->_record->id === 1) {
116
+        if (!$this->_new && (int) $this->_record->id === 1) {
117 117
             $rules[] = ['path', 'used'];
118 118
         } else {
119 119
             $rules[] = ['path', 'required'];
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'];
123 123
         }
124 124
 
125
-        $rules[] = ['title.' . App::$Request->getLanguage(), 'required'];
125
+        $rules[] = ['title.'.App::$Request->getLanguage(), 'required'];
126 126
 
127 127
 
128 128
         return $rules;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         $this->_record->title = $this->title;
137 137
         $this->_record->description = $this->description;
138
-        $savePath = trim($this->_pathNested . '/' . $this->path, '/');
138
+        $savePath = trim($this->_pathNested.'/'.$this->path, '/');
139 139
         $this->_record->path = $savePath;
140 140
         $this->_record->configs = $this->configs;
141 141
         $this->_record->save();
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         // build path with owner category
171 171
         $this->_pathNested = $owner->path;
172 172
         if (Str::length($this->_pathNested) > 0) {
173
-            $path = $this->_pathNested . '/' . $path;
173
+            $path = $this->_pathNested.'/'.$path;
174 174
         }
175 175
 
176 176
         // make select for check
Please login to merge, or discard this patch.
Apps/View/Admin/default/user/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     ]);
56 56
 
57 57
 foreach ($records as $user) {
58
-    $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: ' . $user->role->color . '">' . $user->role->name . '</span>' : $user->role->name;
58
+    $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: '.$user->role->color.'">'.$user->role->name.'</span>' : $user->role->name;
59 59
 
60 60
     $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm'], 4)
61 61
         ->add('<i class="fa fa-pencil"></i>', ['user/update', [$user->id]], ['class' => 'btn btn-primary', 'html' => true])
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)],
76 76
         ['text' => $btngrp->display(),
77 77
             'properties' => ['class' => 'text-center'], 'html' => true],
78
-        'properties' => ['class' => 'checkbox-row' . ($user->approve_token !== null ? ' bg-warning' : null)]
78
+        'properties' => ['class' => 'checkbox-row'.($user->approve_token !== null ? ' bg-warning' : null)]
79 79
 
80 80
     ]);
81 81
 }
Please login to merge, or discard this patch.
Apps/Controller/Api/Comments/ActionShowAnswer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $records = CommentAnswer::with(['user', 'user.profile', 'user.role'])
43 43
             ->where('comment_id', $commentId)
44 44
             ->where('moderate', false);
45
-        if ((bool)$configs['onlyLocale']) {
45
+        if ((bool) $configs['onlyLocale']) {
46 46
             $records = $records->where('lang', $this->request->getLanguage());
47 47
         }
48 48
 
Please login to merge, or discard this patch.
Apps/Controller/Api/Comments/ActionList.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
         // get configs
33 33
         $configs = AppRecord::getConfigs('widget', 'Comments');
34 34
         // items per page
35
-        $perPage = (int)$configs['perPage'];
35
+        $perPage = (int) $configs['perPage'];
36 36
         // offset can be only integer
37
-        $index = (int)$this->request->query->get('offset', 0);
37
+        $index = (int) $this->request->query->get('offset', 0);
38 38
         $offset = $perPage * $index;
39 39
 
40 40
         // select comments from db and check it
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             ->where('moderate', false);
44 44
 
45 45
         // check if comments is depend of language locale
46
-        if ((bool)$configs['onlyLocale']) {
46
+        if ((bool) $configs['onlyLocale']) {
47 47
             $query = $query->where('lang', $this->request->getLanguage());
48 48
         }
49 49
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         // build output json data as array
65 65
         $data = [];
66
-        $records->each(function ($comment) use (&$data){
66
+        $records->each(function($comment) use (&$data){
67 67
             $data[] = (new EntityCommentData($comment))->make();
68 68
         });
69 69
 
Please login to merge, or discard this patch.
Apps/Controller/Api/Profile/ActionMessageList.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         // get special types for this action
45 45
         $queryType = $this->request->get('type');
46
-        $queryId = (int)$this->request->get('id');
46
+        $queryId = (int) $this->request->get('id');
47 47
         // get current user object
48 48
         $user = App::$User->identity();
49 49
 
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
         switch ($queryType) {
60 60
             case 'after':
61 61
                 $messages = Message::where('id', '>', $queryId)
62
-                    ->where(function ($query) use ($corId, $user) {
63
-                        $query->where(function ($q) use ($corId, $user) {
62
+                    ->where(function($query) use ($corId, $user) {
63
+                        $query->where(function($q) use ($corId, $user) {
64 64
                             $q->where('target_id', '=', $user->getId())
65 65
                                 ->where('sender_id', '=', $corId);
66
-                        })->orWhere(function ($q) use ($corId, $user) {
66
+                        })->orWhere(function($q) use ($corId, $user) {
67 67
                             $q->where('target_id', '=', $corId)
68 68
                                 ->where('sender_id', '=', $user->getId());
69 69
                         });
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
                 break;
72 72
             case 'before':
73 73
                 $messages = Message::where('id', '<', $queryId)
74
-                    ->where(function ($query) use ($corId, $user) {
75
-                        $query->where(function ($q) use ($corId, $user) {
74
+                    ->where(function($query) use ($corId, $user) {
75
+                        $query->where(function($q) use ($corId, $user) {
76 76
                             $q->where('target_id', '=', $user->getId())
77 77
                                 ->where('sender_id', '=', $corId);
78
-                        })->orWhere(function ($q) use ($corId, $user) {
78
+                        })->orWhere(function($q) use ($corId, $user) {
79 79
                             $q->where('target_id', '=', $corId)
80 80
                                 ->where('sender_id', '=', $user->getId());
81 81
                         });
82 82
                     });
83 83
                 break;
84 84
             default:
85
-                $messages = Message::where(function ($query) use ($corId, $user) {
85
+                $messages = Message::where(function($query) use ($corId, $user) {
86 86
                     $query->where('target_id', '=', $user->getId())
87 87
                         ->where('sender_id', '=', $corId);
88
-                })->orWhere(function ($query) use ($corId, $user) {
88
+                })->orWhere(function($query) use ($corId, $user) {
89 89
                     $query->where('target_id', '=', $corId)
90 90
                         ->where('sender_id', '=', $user->getId());
91 91
                 });
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
         // build response
107 107
         $response = [];
108
-        $messages->get()->each(function ($msg) use (&$response, $user){
108
+        $messages->get()->each(function($msg) use (&$response, $user){
109 109
             /** @var Message $msg */
110 110
             $response[] = [
111 111
                 'id' => $msg->id,
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             ];
117 117
 
118 118
             // update status to readed
119
-            if (!(bool)$msg->readed && $msg->sender_id !== $user->id) {
119
+            if (!(bool) $msg->readed && $msg->sender_id !== $user->id) {
120 120
                 $msg->readed = true;
121 121
                 $msg->save();
122 122
             }
Please login to merge, or discard this patch.
Apps/Controller/Admin/Comments/Boot.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function boot(): void
26 26
     {
27
-        App::$Event->on(Main::SEARCH_EVENT_NAME, function ($model) {
27
+        App::$Event->on(Main::SEARCH_EVENT_NAME, function($model) {
28 28
             /** @var CollectionSearchResults $model */
29 29
             $records = CommentPost::search($model->getQuery())
30 30
                 ->take($model->getLimit())
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                 $res->setTitle($title);
42 42
                 $res->setSnippet($text);
43 43
                 $res->setDate($item->created_at);
44
-                $res->setRelevance((int)$item->relevance);
44
+                $res->setRelevance((int) $item->relevance);
45 45
                 $res->setUrl('comments/read', [$item->id]);
46 46
                 $res->setMarker('Comment');
47 47
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 $res->setTitle($title);
65 65
                 $res->setSnippet($text);
66 66
                 $res->setDate($item->created_at);
67
-                $res->setRelevance((int)$item->relevance);
67
+                $res->setRelevance((int) $item->relevance);
68 68
                 $res->setUrl('comments/read', [$item->comment_id]);
69 69
                 $res->setMarker('Comment');
70 70
 
Please login to merge, or discard this patch.
Apps/Controller/Admin/User/Boot.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public static function boot(): void
24 24
     {
25
-        App::$Event->on(Main::SEARCH_EVENT_NAME, function ($model) {
25
+        App::$Event->on(Main::SEARCH_EVENT_NAME, function($model) {
26 26
             /** @var CollectionSearchResults $model */
27 27
             $records = User::with('profile')
28 28
                 ->search($model->getQuery())
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
             /** @var User[]|Collection $records */
33 33
             $records->each(function($item) use ($model) {
34 34
                 /** @var User $item */
35
-                $title = $item->login . '(' . $item->email . ')';
35
+                $title = $item->login.'('.$item->email.')';
36 36
                 $text = App::$Translate->get('User', 'Login: %login%, email: %email%, nick: %nick%', [
37 37
                     'login' => $item->login,
38 38
                     'email' => $item->email,
39
-                    'nick' => $item->profile->nick ?? 'id' . $item->id
39
+                    'nick' => $item->profile->nick ?? 'id'.$item->id
40 40
                 ]);
41 41
 
42 42
                 // initialize abstract response pattern
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 $res->setTitle($title);
45 45
                 $res->setSnippet($text);
46 46
                 $res->setDate($item->created_at);
47
-                $res->setRelevance((int)$item->relevance);
47
+                $res->setRelevance((int) $item->relevance);
48 48
                 $res->setUrl('user/update', [$item->id]);
49 49
                 $res->setMarker('User');
50 50
 
Please login to merge, or discard this patch.
Apps/Controller/Admin/Main/Boot.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public static function boot(): void
22 22
     {
23
-        App::$Event->on(Main::SEARCH_EVENT_NAME, function ($model) {
23
+        App::$Event->on(Main::SEARCH_EVENT_NAME, function($model) {
24 24
             /** @var CollectionSearchResults $model */
25 25
             $records = \Apps\ActiveRecord\App::search($model->getQuery())
26 26
                 ->take($model->getLimit())
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
                 $res->setTitle($item->getLocaled('name'));
41 41
                 $res->setSnippet($text);
42 42
                 $res->setDate($item->created_at);
43
-                $res->setRelevance((int)$item->relevance);
44
-                $res->setUrl(Str::lowerCase($item->sys_name) . '/index');
43
+                $res->setRelevance((int) $item->relevance);
44
+                $res->setUrl(Str::lowerCase($item->sys_name).'/index');
45 45
                 $res->setMarker('App');
46 46
 
47 47
                 $model->add($res);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                 return;
66 66
             }
67 67
 
68
-            $files = File::listFiles('/I18n/Admin/' . $usedLanguage, ['.php']);
68
+            $files = File::listFiles('/I18n/Admin/'.$usedLanguage, ['.php']);
69 69
             // each translation files
70 70
             foreach ($files as $file) {
71 71
                 // prepare file name and route target
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 $filter = array_filter($lines, function($target, $en) use ($usedWords, $onlyKeys) {
83 83
                     $enWords = explode(' ', $en);
84 84
                     foreach ($enWords as $enWord) {
85
-                        if(Arr::in($enWord, $usedWords)) {
85
+                        if (Arr::in($enWord, $usedWords)) {
86 86
                             return true;
87 87
                         }
88 88
                     }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 $res->setSnippet(implode('; ', $filter));
111 111
                 $res->setDate(time());
112 112
                 $res->setRelevance($relevance);
113
-                $res->setUrl($route . '/index');
113
+                $res->setUrl($route.'/index');
114 114
                 $res->setMarker('i18n');
115 115
 
116 116
                 $model->add($res);
Please login to merge, or discard this patch.
Apps/Controller/Admin/Feedback/ActionUpdate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             case 'answer':
45 45
                 $record = FeedbackAnswer::find($id);
46 46
                 if ($record) {
47
-                    $postId = (int)$record->post->id;
47
+                    $postId = (int) $record->post->id;
48 48
                 }
49 49
                 break;
50 50
         }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             if ($model->validate()) {
61 61
                 $model->make();
62 62
                 App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed'));
63
-                $this->response->redirect('feedback/read/' . $postId);
63
+                $this->response->redirect('feedback/read/'.$postId);
64 64
             } else {
65 65
                 App::$Session->getFlashBag()->add('danger', __('Updating is failed'));
66 66
             }
Please login to merge, or discard this patch.