Passed
Push — master ( 6042d7...377078 )
by Mihail
04:38
created
Apps/Model/Front/Sitemap/EntityIndexList.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
         $scan = File::listFiles(static::INDEX_PATH, ['.xml'], true);
48 48
         if (Obj::isArray($scan)) {
49 49
             foreach ($scan as $file) {
50
-                if ($this->_lang !== null && !Str::contains('.' . $this->_lang, $file)) {
50
+                if ($this->_lang !== null && !Str::contains('.'.$this->_lang, $file)) {
51 51
                     continue;
52 52
                 }
53
-                $this->files[] = static::INDEX_PATH . '/' . $file;
53
+                $this->files[] = static::INDEX_PATH.'/'.$file;
54 54
             }
55 55
         }
56 56
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         // build file information data
68 68
         foreach ($this->files as $file) {
69 69
             $this->info[] = [
70
-                'loc' => App::$Alias->scriptUrl . $file,
70
+                'loc' => App::$Alias->scriptUrl.$file,
71 71
                 'lastmod' => Date::convertToDatetime(File::mTime($file), 'c')
72 72
             ];
73 73
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/EntityNotificationsList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
             $this->items[] = [
59 59
                 'text' => $text,
60 60
                 'date' => Date::humanize($record->created_at),
61
-                'new' => (bool)$record->readed === false
61
+                'new' => (bool) $record->readed === false
62 62
             ];
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
Apps/View/Front/default/layout/main.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     <?php
24 24
     $customCssCode = \App::$View->showPlainCode('css');
25 25
     if ($customCssCode !== null) {
26
-        echo '<style>' . $customCssCode . '</style>';
26
+        echo '<style>'.$customCssCode.'</style>';
27 27
     } ?>
28 28
     <script>
29 29
         window.jQ = [];
@@ -40,32 +40,32 @@  discard block
 block discarded – undo
40 40
 if (\App::$User->isAuth()) {
41 41
     $userId = \App::$User->identity()->getId();
42 42
     // show 'add content' button if current controller is Content and user add is enabled
43
-    if (\App::$Request->getController() === 'Content' && (bool)AppRecord::getConfig('app', 'Content', 'userAdd')) {
44
-        $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="fa fa-plus"></i> ' . __('Add content'), 'html' => true, 'position' => 'right'];
43
+    if (\App::$Request->getController() === 'Content' && (bool) AppRecord::getConfig('app', 'Content', 'userAdd')) {
44
+        $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="fa fa-plus"></i> '.__('Add content'), 'html' => true, 'position' => 'right'];
45 45
     }
46 46
     $accountDropdown[] = ['link' => ['profile/show', $userId], 'text' => __('My profile')];
47
-    $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true];
48
-    $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true];
49
-    if ((bool)AppRecord::getConfig('app', 'Content', 'userAdd')) {
47
+    $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true];
48
+    $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true];
49
+    if ((bool) AppRecord::getConfig('app', 'Content', 'userAdd')) {
50 50
         $accountDropdown[] = ['link' => ['content/my'], 'text' => __('My content')];
51 51
     }
52 52
     $accountDropdown[] = ['link' => ['profile/settings'], 'text' => __('Settings')];
53 53
 
54 54
     $items[] = [
55 55
         'type' => 'dropdown',
56
-        'text' => '<i class="fa fa-user"></i> ' . __('Account') . ' <span class="badge" id="summary-count-block">0</span>',
56
+        'text' => '<i class="fa fa-user"></i> '.__('Account').' <span class="badge" id="summary-count-block">0</span>',
57 57
         'html' => true,
58 58
         '!secure' => true,
59 59
         'position' => 'right',
60 60
         'items' => $accountDropdown
61 61
     ];
62 62
     if (\App::$User->identity()->getRole()->can('Admin/Main/Index')) {
63
-        $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl . '/admin/', 'text' => '<i class="fa fa-cogs"></i> Admin', 'position' => 'right', 'html' => true];
63
+        $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl.'/admin/', 'text' => '<i class="fa fa-cogs"></i> Admin', 'position' => 'right', 'html' => true];
64 64
     }
65
-    $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="fa fa-user-times"></i> ' . __('Logout'), 'html' => true, 'position' => 'right'];
65
+    $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="fa fa-user-times"></i> '.__('Logout'), 'html' => true, 'position' => 'right'];
66 66
 } else {
67
-    $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="fa fa-sign-in"></i> ' . __('Sign in'), 'position' => 'right', 'html' => true];
68
-    $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="fa fa-check-square-o"></i> ' . __('Sign up'), 'position' => 'right', 'html' => true];
67
+    $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="fa fa-sign-in"></i> '.__('Sign in'), 'position' => 'right', 'html' => true];
68
+    $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="fa fa-check-square-o"></i> '.__('Sign up'), 'position' => 'right', 'html' => true];
69 69
 }
70 70
 
71 71
 echo Navbar::display([
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     'container' => 'container',
76 76
     'collapseId' => 'collapse-object',
77 77
     'items' => $items
78
-]);?>
78
+]); ?>
79 79
 </header>
80 80
 
81 81
 <div class="container body-container">
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 echo $body;
151 151
             } else {
152 152
                 \App::$Response->setStatusCode(404);
153
-                echo '<p>' . __('Page is not founded!') . '</p>';
153
+                echo '<p>'.__('Page is not founded!').'</p>';
154 154
             }
155 155
             ?>
156 156
         </div>
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 <?php
244 244
 $customJsCode = \App::$View->showPlainCode('js');
245 245
 if ($customJsCode !== null) {
246
-    echo '<script>' . $customJsCode . '</script>';
246
+    echo '<script>'.$customJsCode.'</script>';
247 247
 }
248 248
 // render google analytics code here
249 249
 echo \App::$View->render('blocks/googleanalytics');
Please login to merge, or discard this patch.
Widgets/Front/Newcomment/Newcomment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     	    $this->cache = $cfg['cache'];
40 40
     	}
41 41
 
42
-        $this->_cacheName = 'widget.newcomment.' . $this->createStringClassSnapshotHash();
42
+        $this->_cacheName = 'widget.newcomment.'.$this->createStringClassSnapshotHash();
43 43
     }
44 44
 
45 45
     /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         // work with cache and make query
55 55
         $records = null;
56
-        if ((int)$this->cache > 0) {
56
+        if ((int) $this->cache > 0) {
57 57
             if (App::$Cache->get($this->_cacheName) !== null) {
58 58
                 $records = App::$Cache->get($this->_cacheName);
59 59
             } else {
Please login to merge, or discard this patch.
Widgets/Front/Contenttag/Contenttag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
         $cfg = $this->getConfigs();
31 31
         // check cache is defined
32 32
         if ($this->cache === null || !Obj::isLikeInt($this->cache)) {
33
-            $this->cache = (int)$cfg['cache'];
33
+            $this->cache = (int) $cfg['cache'];
34 34
         }
35 35
         // check tag count is defined
36 36
         if ($this->count === null || !Obj::isLikeInt($this->count)) {
37
-            $this->count = (int)$cfg['count'];
37
+            $this->count = (int) $cfg['count'];
38 38
         }
39 39
 
40 40
         $this->_lang = App::$Request->getLanguage();
41
-        $this->_cacheName = 'widget.contenttag.' . $this->createStringClassSnapshotHash();
41
+        $this->_cacheName = 'widget.contenttag.'.$this->createStringClassSnapshotHash();
42 42
     }
43 43
 
44 44
     /**
Please login to merge, or discard this patch.
Widgets/Front/Newcontent/Newcontent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
         }
35 35
         // check cache is defined
36 36
         if ($this->cache === null || !Obj::isLikeInt($this->cache)) {
37
-            $this->cache = (int)$cfg['cache'];
37
+            $this->cache = (int) $cfg['cache'];
38 38
         }
39 39
         // check item count is defined
40 40
         if ($this->count === null || !Obj::isLikeInt($this->count)) {
41
-            $this->count = (int)$cfg['count'];
41
+            $this->count = (int) $cfg['count'];
42 42
         }
43 43
 
44
-        $this->_cacheName = 'widget.newcontent.' . $this->createStringClassSnapshotHash();
44
+        $this->_cacheName = 'widget.newcontent.'.$this->createStringClassSnapshotHash();
45 45
     }
46 46
 
47 47
     /**
Please login to merge, or discard this patch.
Apps/View/Admin/default/feedback/read.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,38 +28,38 @@  discard block
 block discarded – undo
28 28
         <div class="panel panel-info">
29 29
             <div class="panel-heading">
30 30
                 <?php
31
-                if ((int)$record->readed !== 1) {
31
+                if ((int) $record->readed !== 1) {
32 32
                     echo '<i class="fa fa-bell"></i> ';
33 33
                 }
34 34
                 ?>
35 35
                 <?= __('Message sent') ?>: <?= Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>.
36 36
                 <?php
37
-                if ((int)$record->closed !== 1) {
38
-                    echo '<span class="label label-success">' . __('Opened') . '</span>';
37
+                if ((int) $record->closed !== 1) {
38
+                    echo '<span class="label label-success">'.__('Opened').'</span>';
39 39
                 } else {
40
-                    echo '<span class="label label-danger">' . __('Closed') . '</span>';
40
+                    echo '<span class="label label-danger">'.__('Closed').'</span>';
41 41
                 }
42 42
                 ?>
43 43
             </div>
44 44
             <div class="panel-body">
45 45
                 <?php
46
-                if ((int)$record->closed !== 0) {
47
-                    echo '<p class="alert alert-warning">' . __('The feedback request is closed! Thread in only-read mode') . '.</p>';
46
+                if ((int) $record->closed !== 0) {
47
+                    echo '<p class="alert alert-warning">'.__('The feedback request is closed! Thread in only-read mode').'.</p>';
48 48
                 }
49 49
                 ?>
50 50
                 <p><?= Str::replace("\n", "<br />", $record->message) ?></p>
51 51
                 <hr />
52 52
                 <?php
53 53
                 // show "mark as read" button if message is not readed
54
-                if ((int)$record->readed !== 1) {
55
-                    echo Url::link(['feedback/turn', 'read', $record->id], __('Mark as read'), ['class' => 'label label-success']) . ' ';
54
+                if ((int) $record->readed !== 1) {
55
+                    echo Url::link(['feedback/turn', 'read', $record->id], __('Mark as read'), ['class' => 'label label-success']).' ';
56 56
                 }
57 57
 
58 58
                 // show close/open button depend of current status
59
-                if ((int)$record->closed === 0) {
60
-                    echo Url::link(['feedback/turn', 'close', $record->id], __('Close'), ['class' => 'label label-warning']) . ' ';
59
+                if ((int) $record->closed === 0) {
60
+                    echo Url::link(['feedback/turn', 'close', $record->id], __('Close'), ['class' => 'label label-warning']).' ';
61 61
                 } else {
62
-                    echo Url::link(['feedback/turn', 'open', $record->id], __('Open'), ['class' => 'label label-info']) . ' ';
62
+                    echo Url::link(['feedback/turn', 'open', $record->id], __('Open'), ['class' => 'label label-info']).' ';
63 63
                 }
64 64
 
65 65
                 ?>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             <div class="panel-body">
77 77
                 <?php
78 78
                 $uInfo = 'no';
79
-                if ((int)$record->user_id > 0) {
79
+                if ((int) $record->user_id > 0) {
80 80
                     $user = \App::$User->identity($record->user_id);
81 81
                     if ($user !== null && $user->getId() > 0) {
82 82
                         $uInfo = Url::link(['user/update', $user->getId()], $user->getProfile()->getNickname());
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 
102 102
 <?php if ($record->getAnswers()->count() > 0): ?>
103 103
     <?php foreach ($record->getAnswers()->get() as $answer): ?>
104
-        <div class="panel <?= (int)$answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>">
104
+        <div class="panel <?= (int) $answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>">
105 105
             <div class="panel-heading">
106
-                <?= __('From') ?>: <?= $answer->name . '(' . $answer->email . ')' . ((int)$answer->user_id > 0 ? Url::link(['user/update', $answer->user_id], '[id' . $answer->user_id . ']') : null) ?>,
106
+                <?= __('From') ?>: <?= $answer->name.'('.$answer->email.')'.((int) $answer->user_id > 0 ? Url::link(['user/update', $answer->user_id], '[id'.$answer->user_id.']') : null) ?>,
107 107
                 <?= Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?>
108 108
                 <span class="pull-right">
109 109
                     <?= Url::link(['feedback/update', 'answer', $answer->id], __('Edit'), ['class' => 'label label-primary']) ?>
Please login to merge, or discard this patch.
Apps/View/Admin/default/user/user_delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 <?php
58 58
     $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post', 'action' => '']);
59 59
     echo $form->start();
60
-    echo $form->submitButton(__('Delete'), ['class' => 'btn btn-danger']) . "&nbsp;";
60
+    echo $form->submitButton(__('Delete'), ['class' => 'btn btn-danger'])."&nbsp;";
61 61
     echo Url::link(['user/index'], __('Cancel'), ['class' => 'btn btn-default']);
62 62
     echo $form->finish();
63 63
 ?>
64 64
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Controller/Front/Feedback.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
     {
42 42
         // get configs
43 43
         $configs = $this->getConfigs();
44
-        if (!App::$User->isAuth() && (int)$configs['guestAdd'] !== 1) {
44
+        if (!App::$User->isAuth() && (int) $configs['guestAdd'] !== 1) {
45 45
             throw new ForbiddenException(__('Feedback available only for authorized users'));
46 46
         }
47 47
 
48 48
         // initialize model
49
-        $model = new FormFeedbackAdd((int)$configs['useCaptcha'] === 1);
49
+        $model = new FormFeedbackAdd((int) $configs['useCaptcha'] === 1);
50 50
         if ($model->send()) {
51 51
             if ($model->validate()) {
52 52
                 // if validation is passed save data to db and get row
53 53
                 $record = $model->make();
54 54
                 App::$Session->getFlashBag()->add('success', __('Your message was added successful'));
55
-                $this->response->redirect('feedback/read/' . $record->id . '/' . $record->hash);
55
+                $this->response->redirect('feedback/read/'.$record->id.'/'.$record->hash);
56 56
             } else {
57 57
                 App::$Session->getFlashBag()->add('error', __('Message is not sended! Please, fix issues in form below'));
58 58
             }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         // render output view
62 62
         return $this->view->render('create', [
63 63
             'model' => $model->filter(),
64
-            'useCaptcha' => (int)$configs['useCaptcha'] === 1
64
+            'useCaptcha' => (int) $configs['useCaptcha'] === 1
65 65
         ]);
66 66
     }
67 67
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $userId = App::$User->isAuth() ? App::$User->identity()->getId() : 0;
94 94
         $model = null;
95 95
         // check if feedback post is not closed for answers
96
-        if ((int)$recordPost->closed === 0) {
96
+        if ((int) $recordPost->closed === 0) {
97 97
             // init new answer add model
98 98
             $model = new FormAnswerAdd($recordPost, $userId);
99 99
             // if answer is sender lets try to make it model
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
         // check if action is submited
139 139
         if ($this->request->request->get('closeRequest', false)) {
140 140
             // if created by authorized user
141
-            if ((int)$record->user_id !== 0) {
141
+            if ((int) $record->user_id !== 0) {
142 142
                 $user = App::$User->identity();
143 143
                 // button is pressed not by request creator
144
-                if ($user === null || $user->getId() !== (int)$record->user_id) {
144
+                if ($user === null || $user->getId() !== (int) $record->user_id) {
145 145
                     throw new ForbiddenException(__('This feedback request was created by another user'));
146 146
                 }
147 147
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
             // add notification and redirect
154 154
             App::$Session->getFlashBag()->add('warning', __('Feedback request now is closed!'));
155
-            $this->response->redirect('feedback/read/' . $id . '/' . $hash);
155
+            $this->response->redirect('feedback/read/'.$id.'/'.$hash);
156 156
         }
157 157
 
158 158
         return $this->view->render('close');
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     public function actionList()
169 169
     {
170 170
         // set current page and offset
171
-        $page = (int)$this->request->query->get('page');
171
+        $page = (int) $this->request->query->get('page');
172 172
         $offset = $page * self::ITEM_PER_PAGE;
173 173
 
174 174
         // check if user is authorized or throw exception
Please login to merge, or discard this patch.