Passed
Push — master ( 4142cd...6084dc )
by Mihail
05:14
created
Apps/View/Front/default/widgets/comments/show.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
     </li>
55 55
 </ul>
56 56
 
57
-<?php if ((int)$configs['guestAdd'] === 1 || \App::$User->isAuth()): ?>
57
+<?php if ((int) $configs['guestAdd'] === 1 || \App::$User->isAuth()): ?>
58 58
 <!-- comment form -->
59 59
 <form name="comment-add-form" action="" method="post" style="padding-top: 15px;" class="form-horizontal">
60 60
     <input type="hidden" name="replay-to" value="0" />
Please login to merge, or discard this patch.
Apps/Controller/Admin/Main.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
         // cache some data
33 33
         $rootSize = App::$Cache->get('root.size');
34 34
         if ($rootSize === null) {
35
-            $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb';
35
+            $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2) . ' mb';
36 36
             App::$Cache->set('root.size', $rootSize, 60 * 60 * 24); // 24 hours caching
37 37
         }
38 38
         $loadAvg = App::$Cache->get('load.average');
39 39
         if ($loadAvg === null) {
40 40
             $loadAvg = Environment::loadAverage();
41
-            App::$Cache->set('load.average', $loadAvg, 60*2); // 2 min cache
41
+            App::$Cache->set('load.average', $loadAvg, 60 * 2); // 2 min cache
42 42
         }
43 43
 
44 44
         $stats = [
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function actionDeleteroute()
147 147
     {
148
-        $type = (string)App::$Request->query->get('type');
149
-        $loader = (string)App::$Request->query->get('loader');
150
-        $source = Str::lowerCase((string)App::$Request->query->get('path'));
148
+        $type = (string) App::$Request->query->get('type');
149
+        $loader = (string) App::$Request->query->get('loader');
150
+        $source = Str::lowerCase((string) App::$Request->query->get('path'));
151 151
 
152 152
         $model = new EntityDeleteRoute($type, $loader, $source);
153 153
         if ($model->send()) {
Please login to merge, or discard this patch.
Apps/Controller/Api/Comments.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $this->setJsonHeader();
26 26
         $configs = AppRecord::getConfigs('widget', 'Comments');
27 27
 
28
-        $replayTo = (int)App::$Request->request->get('replay-to');
28
+        $replayTo = (int) App::$Request->request->get('replay-to');
29 29
         $model = null;
30 30
         // check if its a answer (comment answer type)
31 31
         if ($replayTo > 0) {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         // pass general comment params to model
40
-        $model->message = App::$Security->secureHtml((string)App::$Request->request->get('message'));
40
+        $model->message = App::$Security->secureHtml((string) App::$Request->request->get('message'));
41 41
         $model->guestName = App::$Security->strip_tags(App::$Request->request->get('guest-name'));
42 42
 
43 43
         // check model conditions before add new row
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
         // set header
62 62
         $this->setJsonHeader();
63 63
         // get config count per page
64
-        $perPage = (int)AppRecord::getConfig('widget', 'Comments', 'perPage');
64
+        $perPage = (int) AppRecord::getConfig('widget', 'Comments', 'perPage');
65 65
         // offset can be only integer
66
-        $index = (int)$index;
66
+        $index = (int) $index;
67 67
         $offset = $perPage * $index;
68 68
         // get comment target path and check
69
-        $path = (string)App::$Request->query->get('path');
69
+        $path = (string) App::$Request->query->get('path');
70 70
         if (Str::likeEmpty($path)) {
71 71
             throw new JsonException('Wrong path');
72 72
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     public function actionShowanswers($commentId)
110 110
     {
111 111
         // check input data
112
-        if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) {
112
+        if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) {
113 113
             throw new JsonException('Input data is incorrect');
114 114
         }
115 115
 
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentPostAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function check()
57 57
     {
58 58
         // check if user is auth'd or guest name is defined
59
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
59
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60 60
             throw new JsonException(__('Guest name is not defined'));
61 61
         }
62 62
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // check if message length is correct
69
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
69
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
70 70
             throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [
71 71
                 'cur' => Str::length($this->message),
72 72
                 'min' => $this->_configs['minLength'],
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function check()
57 57
     {
58 58
         // check if user is auth'd or guest name is defined
59
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
59
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60 60
             throw new JsonException(__('Guest name is not defined'));
61 61
         }
62 62
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // check if message length is correct
69
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
69
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
70 70
             throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [
71 71
                 'cur' => Str::length($this->message),
72 72
                 'min' => $this->_configs['minLength'],
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentAnswerAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function check()
57 57
     {
58 58
         // check if user is auth'd or guest name is defined
59
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
59
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60 60
             throw new JsonException(__('Guest name is not defined'));
61 61
         }
62 62
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // check if message length is correct
69
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
69
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
70 70
             throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [
71 71
                 'cur' => Str::length($this->message),
72 72
                 'min' => $this->_configs['minLength'],
Please login to merge, or discard this patch.