Passed
Push — master ( 6042d7...377078 )
by Mihail
04:38
created
Apps/Model/Admin/User/FormUserSettings.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
     }
28 28
 
29 29
     /**
30
-    * Load configs from app data
31
-    */
30
+     * Load configs from app data
31
+     */
32 32
     public function before()
33 33
     {
34 34
         if ($this->_config === null) {
Please login to merge, or discard this patch.
Apps/Model/Admin/Newcontent/FormSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
     */
27 27
     public function before()
28 28
     {
29
-        $this->count = (int)$this->_configs['count'];
30
-        $this->cache = (int)$this->_configs['cache'];
29
+        $this->count = (int) $this->_configs['count'];
30
+        $this->cache = (int) $this->_configs['cache'];
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentUpdate.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if ($this->_content->id === null) {
60 60
             $this->_new = true;
61 61
             if (null === $this->galleryFreeId) {
62
-                $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32));
62
+                $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32));
63 63
             }
64 64
             if (null === $this->authorId) {
65 65
                 $this->authorId = App::$User->identity()->getId();
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
     public function rules()
92 92
     {
93 93
         $res = [
94
-            ['title.' . App::$Request->getLanguage(), 'required'],
95
-            ['text.' . App::$Request->getLanguage(), 'required'],
94
+            ['title.'.App::$Request->getLanguage(), 'required'],
95
+            ['text.'.App::$Request->getLanguage(), 'required'],
96 96
             ['text', 'used'],
97 97
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
98 98
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'],
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         ];
106 106
 
107 107
         foreach (App::$Properties->get('languages') as $lang) {
108
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
109
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
110
-            $res[] = ['description.' . $lang, 'length_max', 250];
108
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
109
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
110
+            $res[] = ['description.'.$lang, 'length_max', 250];
111 111
         }
112 112
 
113 113
         return $res;
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         $this->_content->meta_description = Serialize::encode($this->metaDescription);
164 164
         $this->_content->source = $this->source;
165 165
         // check if rating is changed
166
-        if ((int)$this->addRating !== 0) {
167
-            $this->_content->rating += (int)$this->addRating;
166
+        if ((int) $this->addRating !== 0) {
167
+            $this->_content->rating += (int) $this->addRating;
168 168
         }
169 169
         // check if special comment hash is exist
170 170
         if ($this->_new || Str::length($this->_content->comment_hash) < 32) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         }
177 177
 
178 178
         // save poster data
179
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
179
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
180 180
         if (File::exist($posterPath)) {
181 181
             $this->_content->poster = $this->poster;
182 182
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         // move files
213 213
         if ($tmpGalleryId !== $this->_content->id) {
214
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
214
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
215 215
         }
216 216
     }
217 217
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $data = ContentCategory::getSortedCategories();
225 225
         $response = [];
226 226
         foreach ($data as $key=>$val) {
227
-            $response[] = (string)$key;
227
+            $response[] = (string) $key;
228 228
         }
229 229
         return $response;
230 230
     }
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentClear.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     {
44 44
         // remove gallery files if exists
45 45
         foreach ($this->_records->get() as $record) {
46
-            $galleryPath = '/upload/gallery/' . (int)$record->id;
46
+            $galleryPath = '/upload/gallery/'.(int) $record->id;
47 47
             if (Directory::exist($galleryPath)) {
48 48
                 Directory::remove($galleryPath);
49 49
             }
Please login to merge, or discard this patch.
Apps/Model/Front/User/FormLogin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     {
71 71
         $password = App::$Security->password_hash($this->password);
72 72
 
73
-        $search = App::$User->where('password', '=', $password)->where(function ($query) {
73
+        $search = App::$User->where('password', '=', $password)->where(function($query) {
74 74
             $query->where('login', '=', $this->login)
75 75
                 ->orWhere('email', '=', $this->login);
76 76
         });
Please login to merge, or discard this patch.
Extend/Core/Arch/FrontAppController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         }
32 32
 
33 33
         // add localizations
34
-        App::$Translate->append(App::$Alias->currentViewPath . '/I18n/' . App::$Request->getLanguage() . '.php');
34
+        App::$Translate->append(App::$Alias->currentViewPath.'/I18n/'.App::$Request->getLanguage().'.php');
35 35
 
36 36
         parent::__construct();
37 37
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         }
55 55
 
56 56
         // check if disabled (0 = enabled, anything else = on)
57
-        return (int)$this->application->disabled === 0;
57
+        return (int) $this->application->disabled === 0;
58 58
     }
59 59
 
60 60
     /**
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         if ($this->configs !== null) {
67 67
             return $this->configs;
68 68
         }
69
-        $configs = (array)$this->application->configs;
69
+        $configs = (array) $this->application->configs;
70 70
         foreach ($configs as $cfg => $value) {
71 71
             if (Obj::isLikeInt($value)) {
72
-                $configs[$cfg] = (int)$value; // convert string 1 "1" to int 1 1
72
+                $configs[$cfg] = (int) $value; // convert string 1 "1" to int 1 1
73 73
             }
74 74
         }
75 75
         $this->configs = $configs;
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         // labels for custom fields
73 73
         foreach (ProfileField::all() as $custom) {
74
-            $labels['custom_data.' . $custom->id] = $custom->getLocaled('name');
74
+            $labels['custom_data.'.$custom->id] = $custom->getLocaled('name');
75 75
         }
76 76
 
77 77
         return $labels;
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
         // custom profile fields
98 98
         foreach (ProfileField::all() as $custom) {
99 99
             $rules[] = [
100
-                'custom_data.' . $custom->id,
100
+                'custom_data.'.$custom->id,
101 101
                 'used'
102 102
             ];
103 103
             $rules[] = [
104
-                'custom_data.' . $custom->id,
105
-                (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match',
104
+                'custom_data.'.$custom->id,
105
+                (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match',
106 106
                 $custom->reg_exp
107 107
             ];
108 108
         }
Please login to merge, or discard this patch.
Apps/ActiveRecord/ContentCategory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public static function all($columns = ['*'])
36 36
     {
37
-        $cacheName = 'activerecord.contentcategory.all.' . implode('.', $columns);
37
+        $cacheName = 'activerecord.contentcategory.all.'.implode('.', $columns);
38 38
         $records = MemoryObject::instance()->get($cacheName);
39 39
         if ($records === null) {
40 40
             $records = parent::all($columns);
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function getByPath($path = '')
52 52
     {
53
-        if (MainApp::$Memory->get('cache.content.category.path.' . $path) !== null) {
54
-            return MainApp::$Memory->get('cache.content.category.path.' . $path);
53
+        if (MainApp::$Memory->get('cache.content.category.path.'.$path) !== null) {
54
+            return MainApp::$Memory->get('cache.content.category.path.'.$path);
55 55
         }
56 56
 
57 57
         $record = self::where('path', '=', $path)->first();
58
-        MainApp::$Memory->set('cache.content.category.path.' . $path, $record);
58
+        MainApp::$Memory->set('cache.content.category.path.'.$path, $record);
59 59
         return $record;
60 60
     }
61 61
 
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public static function getById($id)
68 68
     {
69
-        if (MainApp::$Memory->get('cache.content.category.id.' . $id) !== null) {
70
-            return MainApp::$Memory->get('cache.content.category.id.' . $id);
69
+        if (MainApp::$Memory->get('cache.content.category.id.'.$id) !== null) {
70
+            return MainApp::$Memory->get('cache.content.category.id.'.$id);
71 71
         }
72 72
 
73 73
         $record = self::find($id);
74
-        MainApp::$Memory->set('cache.content.category.id.' . $id, $record);
74
+        MainApp::$Memory->set('cache.content.category.id.'.$id, $record);
75 75
         return $record;
76 76
     }
77 77
 
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
             } else {
100 100
                 // set level marker based on slashes count in pathway
101 101
                 $slashCount = Str::entryCount($path, '/');
102
-                for ($i=-1; $i <= $slashCount; $i++) {
102
+                for ($i = -1; $i <= $slashCount; $i++) {
103 103
                     $title .= '--';
104 104
                 }
105 105
             }
106 106
             // add canonical title from db
107
-            $title .= ' ' . $data->getLocaled('title');
107
+            $title .= ' '.$data->getLocaled('title');
108 108
             // set response as array [id => title, ... ]
109 109
             $response[$data->id] = $title;
110 110
         }
Please login to merge, or discard this patch.
Apps/View/Admin/default/content/index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
                     <span class="sr-only">Toggle Dropdown</span>
35 35
                 </button>
36 36
                 <ul class="dropdown-menu" role="menu">
37
-                    <li><?= Url::link(['content/index', null, null, ['type' => 'all']], '<i class="fa fa-list"></i> ' . __('All')) ?></li>
38
-                    <li><?= Url::link(['content/index', null, null, ['type' => 'moderate']], '<i class="fa fa-exclamation"></i> ' . __('Moderate')) ?></li>
39
-                    <li><?= Url::link(['content/index', null, null, ['type' => 'trash']], '<i class="fa fa-trash"></i> ' . __('Trash')) ?></li>
37
+                    <li><?= Url::link(['content/index', null, null, ['type' => 'all']], '<i class="fa fa-list"></i> '.__('All')) ?></li>
38
+                    <li><?= Url::link(['content/index', null, null, ['type' => 'moderate']], '<i class="fa fa-exclamation"></i> '.__('Moderate')) ?></li>
39
+                    <li><?= Url::link(['content/index', null, null, ['type' => 'trash']], '<i class="fa fa-trash"></i> '.__('Trash')) ?></li>
40 40
                     <li>
41 41
                         <a class="trigger right-caret"><i class="fa fa-table"></i> <?= __('Categories') ?></a>
42 42
                         <ul class="dropdown-menu sub-menu">
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
         </div>
51 51
         <?php
52 52
         if ($type === 'trash') {
53
-            echo Url::link(['content/clear'], '<i class="fa fa-minus"></i> ' . __('Remove all'), ['class' => 'btn btn-danger pull-right']);
53
+            echo Url::link(['content/clear'], '<i class="fa fa-minus"></i> '.__('Remove all'), ['class' => 'btn btn-danger pull-right']);
54 54
         } else {
55
-            echo Url::link(['content/update', 0], '<i class="fa fa-plus"></i> ' . __('Add content'), ['class' => 'btn btn-primary pull-right']);
55
+            echo Url::link(['content/update', 0], '<i class="fa fa-plus"></i> '.__('Add content'), ['class' => 'btn btn-primary pull-right']);
56 56
         }
57 57
         ?>
58 58
     </div>
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
 <?php
62 62
 
63 63
 if ($records->count() < 1) {
64
-    echo '<p class="alert alert-warning">' . __('Content is not found') . '</p>';
64
+    echo '<p class="alert alert-warning">'.__('Content is not found').'</p>';
65 65
     return;
66 66
 }
67 67
 
68 68
 $items = [];
69 69
 $moderate = false;
70 70
 foreach ($records as $content) {
71
-    $frontLink = \App::$Alias->scriptUrl . '/content/read';
71
+    $frontLink = \App::$Alias->scriptUrl.'/content/read';
72 72
     $frontPath = null;
73 73
     if (!Str::likeEmpty($content->getCategory()->path)) {
74
-        $frontLink .= '/' . $content->getCategory()->path;
75
-        $frontPath .= '/' . $content->getCategory()->path;
74
+        $frontLink .= '/'.$content->getCategory()->path;
75
+        $frontPath .= '/'.$content->getCategory()->path;
76 76
     }
77
-    $frontLink .= '/' . $content->path;
78
-    $frontPath .= '/' . $content->path;
77
+    $frontLink .= '/'.$content->path;
78
+    $frontPath .= '/'.$content->path;
79 79
     $frontPath = Str::sub($frontPath, 0, 30);
80
-    $actionIcons = '<a href="' . $frontLink . '" target="_blank"><i class="fa fa-eye fa-lg"></i></a> ';
80
+    $actionIcons = '<a href="'.$frontLink.'" target="_blank"><i class="fa fa-eye fa-lg"></i></a> ';
81 81
     $actionIcons .= Url::link(['content/update', $content->id], '<i class="fa fa-pencil fa-lg"></i> ');
82 82
     if ($type === 'trash') {
83 83
         $actionIcons .= Url::link(['content/restore', $content->id], '<i class="fa fa-refresh fa-lg"></i>');
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
         $actionIcons .= Url::link(['content/delete', $content->id], '<i class="fa fa-trash-o fa-lg"></i>');
86 86
     }
87 87
 
88
-    if (!(bool)$content->display) {
88
+    if (!(bool) $content->display) {
89 89
         $moderate = true;
90 90
     }
91 91
 
92 92
     $items[] = [
93
-        'property' => ['class' => 'checkbox-row' . (!(bool)$content->display ? ' alert-warning' : null)],
93
+        'property' => ['class' => 'checkbox-row'.(!(bool) $content->display ? ' alert-warning' : null)],
94 94
         1 => ['text' => $content->id, 'html' => true, '!secure' => true],
95
-        2 => ['text' => (!(bool)$content->display ? '<i class="fa fa-exclamation text-warning"></i> ' : null) . Url::link(['content/update', $content->id], $content->getLocaled('title')), 'html' => true],
95
+        2 => ['text' => (!(bool) $content->display ? '<i class="fa fa-exclamation text-warning"></i> ' : null).Url::link(['content/update', $content->id], $content->getLocaled('title')), 'html' => true],
96 96
         3 => ['text' => $content->getCategory()->getLocaled('title')],
97
-        4 =>['text' => '<a href="' . $frontLink . '" target="_blank">' . $frontPath . '</a>', 'html' => true],
97
+        4 =>['text' => '<a href="'.$frontLink.'" target="_blank">'.$frontPath.'</a>', 'html' => true],
98 98
         5 => ['text' => Date::convertToDatetime($content->updated_at, Date::FORMAT_TO_SECONDS)],
99 99
         6 => ['text' => $actionIcons, 'html' => true, 'property' => ['class' => 'text-center']]
100 100
     ];
Please login to merge, or discard this patch.