Passed
Push — master ( 0206ad...aeb2a3 )
by Mihail
03:59
created
Apps/Model/Front/User/FormSocialAuth.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function __construct($provider, $identity)
40 40
     {
41
-        $this->_provider_name = (string)$provider;
41
+        $this->_provider_name = (string) $provider;
42 42
         $this->_identity = $identity;
43 43
         parent::__construct(false);
44 44
     }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             }
126 126
             // set birthday if available
127 127
             if ($this->_identity->birthDay !== null && $this->_identity->birthMonth !== null && $this->_identity->birthYear !== null) {
128
-                $profile->birthday = $this->_identity->birthYear . '-' . $this->_identity->birthMonth . '-' . $this->_identity->birthDay;
128
+                $profile->birthday = $this->_identity->birthYear.'-'.$this->_identity->birthMonth.'-'.$this->_identity->birthDay;
129 129
             }
130 130
 
131 131
             // try to parse avatar from remote service
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     protected function parseAvatar($url, $userId)
149 149
     {
150 150
         // check if user is defined
151
-        if ((int)$userId < 1) {
151
+        if ((int) $userId < 1) {
152 152
             return;
153 153
         }
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         }
166 166
 
167 167
         // write image to filesystem
168
-        $imagePath = '/upload/user/avatar/original/' . $userId . '.' . $imageExtension;
168
+        $imagePath = '/upload/user/avatar/original/'.$userId.'.'.$imageExtension;
169 169
         $write = File::write($imagePath, $imageContent);
170 170
         if ($write === false) {
171 171
             return;
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         // try to write and resize file
175 175
         try {
176
-            $fileObject = new FileObject(root . $imagePath);
176
+            $fileObject = new FileObject(root.$imagePath);
177 177
             $avatarUpload = new FormAvatarUpload();
178 178
             $avatarUpload->resizeAndSave($fileObject, $userId, 'small');
179 179
             $avatarUpload->resizeAndSave($fileObject, $userId, 'medium');
Please login to merge, or discard this patch.
Loader/Console/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     die();
7 7
 }
8 8
 
9
-require_once (root . '/Loader/Autoload.php');
9
+require_once (root.'/Loader/Autoload.php');
10 10
 
11 11
 class Console extends Ffcms\Console\Console {}
12 12
 
@@ -18,5 +18,5 @@  discard block
 block discarded – undo
18 18
     // display output
19 19
     echo \Console::run();
20 20
 } catch (Exception $e) {
21
-    echo $e->getMessage() . "\n";
21
+    echo $e->getMessage()."\n";
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Controller/Console/Db.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function actionImport($activeRecord)
26 26
     {
27
-        $importFile = root . '/Private/Database/Tables/' . ucfirst(strtolower($activeRecord)) . '.php';
27
+        $importFile = root.'/Private/Database/Tables/'.ucfirst(strtolower($activeRecord)).'.php';
28 28
         if (!File::exist($importFile)) {
29
-            return 'Database model table not founded: ' . $activeRecord;
29
+            return 'Database model table not founded: '.$activeRecord;
30 30
         }
31 31
 
32 32
         @include($importFile);
33
-        return 'Database table import done: ' . $activeRecord;
33
+        return 'Database table import done: '.$activeRecord;
34 34
     }
35 35
 
36 36
     /**
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function actionImportAll($connectName = 'default')
42 42
     {
43
-        $importFile = root . '/Private/Database/install.php';
43
+        $importFile = root.'/Private/Database/install.php';
44 44
         if (!File::exist($importFile)) {
45
-            return 'Import file is not exist: ' . $importFile;
45
+            return 'Import file is not exist: '.$importFile;
46 46
         }
47 47
         @include($importFile);
48 48
         return 'All database tables was imported!';
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
             throw new NativeException('Password is bad');
72 72
         }
73 73
         echo "RoleId (1 = onlyread, 2 = user, 3 = moderator, 4 = admin):";
74
-        $role = (int)Console::$Input->read();
75
-        if (!Arr::in($role, [1,2,3,4])) {
74
+        $role = (int) Console::$Input->read();
75
+        if (!Arr::in($role, [1, 2, 3, 4])) {
76 76
             $role = 2;
77 77
         }
78 78
 
Please login to merge, or discard this patch.
Apps/View/Front/default/profile/index.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 $this->title = __('User list');
15 15
 
16 16
 if ($id === 'all') {
17
-    $this->title .= ': ' . __('All');
17
+    $this->title .= ': '.__('All');
18 18
 } elseif ($id === 'rating') {
19
-    $this->title .= ': ' . __('Rating');
19
+    $this->title .= ': '.__('Rating');
20 20
 } elseif ($id === 'city') {
21
-    $this->title .= ': ' . __('City') . ' ' . \App::$Security->strip_tags($add);
21
+    $this->title .= ': '.__('City').' '.\App::$Security->strip_tags($add);
22 22
 } elseif ($id === 'hobby') {
23
-    $this->title .= ': ' . __('Hobby') . ' ' . \App::$Security->strip_tags($add);
23
+    $this->title .= ': '.__('Hobby').' '.\App::$Security->strip_tags($add);
24 24
 }
25 25
 
26 26
 $this->breadcrumbs = [
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 <?php
37 37
     if ($records === null || $records->count() < 1) {
38
-        echo '<div class="alert alert-danger">' . __('Users are not founded!') . '</div>';
38
+        echo '<div class="alert alert-danger">'.__('Users are not founded!').'</div>';
39 39
         return;
40 40
     }
41 41
 ?>
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
         </div>
49 49
         <div class="col-md-8">
50 50
             <h3>
51
-                <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') . '(id' . $profile->user_id . ')' : $profile->nick) ?>
51
+                <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name').'(id'.$profile->user_id.')' : $profile->nick) ?>
52 52
             </h3>
53 53
             <p><?= __('Registered') ?>: <?= Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY) ?></p>
54 54
             <?php if (\App::$User->identity() !== null && $profile->user_id !== \App::$User->identity()->getId()): ?>
55
-                <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> '  . __('New message'), ['class' => 'btn btn-info']) ?>
55
+                <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> '.__('New message'), ['class' => 'btn btn-info']) ?>
56 56
             <?php endif; ?>
57 57
         </div>
58 58
         <div class="col-md-2">
Please login to merge, or discard this patch.
Private/Config/Object.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 date_default_timezone_set(App::$Properties->get('timezone'));
14 14
 
15 15
 return [
16
-    'Database' => function () {
16
+    'Database' => function() {
17 17
         $capsule = new Capsule;
18 18
         if (env_name !== 'Install') {
19 19
             try {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             try {
35 35
                 $capsule->connection()->getPdo();
36 36
             } catch (\Exception $e) {
37
-                $instUri = \App::$Alias->scriptUrl . '/install';
37
+                $instUri = \App::$Alias->scriptUrl.'/install';
38 38
                 \App::$Response->redirect($instUri, true);
39 39
             }
40 40
         }
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
         try {
47 47
             $pdo = \App::$Database->connection()->getPdo();
48 48
             $handler = new PdoSessionHandler($pdo, [
49
-                'db_table' => App::$Properties->get('database')['prefix'] . 'sessions'
49
+                'db_table' => App::$Properties->get('database')['prefix'].'sessions'
50 50
             ]);
51 51
         } catch (Exception $e) {
52
-            $handler = new NativeFileSessionHandler(root . '/Private/Sessions');
52
+            $handler = new NativeFileSessionHandler(root.'/Private/Sessions');
53 53
         }
54 54
 
55 55
         $storage = new NativeSessionStorage([
@@ -60,21 +60,21 @@  discard block
 block discarded – undo
60 60
 
61 61
         return new Session($storage);
62 62
     },
63
-    'User' => function () {
63
+    'User' => function() {
64 64
         return new Apps\ActiveRecord\User();
65 65
     },
66
-    'Mailer' => function () {
66
+    'Mailer' => function() {
67 67
         $swiftTransport = Swift_MailTransport::newInstance();
68 68
         return Swift_Mailer::newInstance($swiftTransport);
69 69
     },
70
-    'Captcha' => function () {
70
+    'Captcha' => function() {
71 71
         return new Extend\Core\Captcha\Gregwar();
72 72
     },
73
-    'Cache' => function () {
73
+    'Cache' => function() {
74 74
         // initialize cache manager. You can use redis, memcache or anything else. Look at: phpfastcache.com
75 75
         CacheManager::setup([
76 76
             'storage' => 'files',
77
-            'path' => root . '/Private/Cache'
77
+            'path' => root.'/Private/Cache'
78 78
         ]);
79 79
         return CacheManager::getInstance('files');
80 80
     },
Please login to merge, or discard this patch.
Private/Config/Routing.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php return [
2
-	'Alias' => [
3
-		'Front' => [
4
-			'/' => '/content/list/news'
5
-		]
6
-	]
2
+    'Alias' => [
3
+        'Front' => [
4
+            '/' => '/content/list/news'
5
+        ]
6
+    ]
7 7
 ];
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/View/Admin/default/main/routing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,5 +95,5 @@
 block discarded – undo
95 95
 </div>
96 96
 <?php if (count($staticItems) < 1 && count($dynamicItems) < 1): ?>
97 97
     <p class="alert alert-warning"><?= __('Custom routes is not yet found') ?></p>
98
-<?php endif ;?>
99
-<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> ' . __('New route'), ['class' => 'btn btn-primary']) ?>
100 98
\ No newline at end of file
99
+<?php endif; ?>
100
+<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> '.__('New route'), ['class' => 'btn btn-primary']) ?>
101 101
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityCategoryList.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->_path = $path;
61 61
         $this->_configs = $configs;
62
-        $this->_page = (int)$offset;
62
+        $this->_page = (int) $offset;
63 63
         $this->_sort = $sort;
64 64
         parent::__construct();
65 65
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function before()
73 73
     {
74 74
         // find one or more categories where we must looking for content items
75
-        if ((int)$this->_configs['multiCategories'] === 1) {
75
+        if ((int) $this->_configs['multiCategories'] === 1) {
76 76
             $this->findCategories();
77 77
         } else {
78 78
             $this->findCategory();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function setItemLimit($limit)
93 93
     {
94
-        $this->_customItemLimit = (int)$limit;
94
+        $this->_customItemLimit = (int) $limit;
95 95
     }
96 96
 
97 97
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     private function findCategories()
120 120
     {
121 121
         // get all categories for current path and child of it
122
-        $query = ContentCategory::where('path', 'like', $this->_path . '%');
122
+        $query = ContentCategory::where('path', 'like', $this->_path.'%');
123 123
         if ($query->count() < 1) {
124 124
             throw new NotFoundException(__('Category is not founded'));
125 125
         }
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         // calculate selection offset
155
-        $itemPerPage = (int)$this->_configs['itemPerCategory'];
155
+        $itemPerPage = (int) $this->_configs['itemPerCategory'];
156 156
         // check if custom itemlimit defined over model api
157 157
         if ($this->_customItemLimit !== false) {
158
-            $itemPerPage = (int)$this->_customItemLimit;
158
+            $itemPerPage = (int) $this->_customItemLimit;
159 159
         }
160 160
 
161 161
         $offset = $this->_page * $itemPerPage;
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
         $catConfigs = Serialize::decode($this->_currentCategory->configs);
198 198
         // prepare rss url link for current category if enabled
199 199
         $rssUrl = false;
200
-        if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) {
201
-            $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path;
200
+        if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) {
201
+            $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path;
202 202
             $rssUrl = rtrim($rssUrl, '/');
203 203
         }
204 204
 
205 205
         // prepare sorting urls
206 206
         $catSortParams = [];
207 207
         if (App::$Request->query->get('page') !== null) {
208
-            $catSortParams['page'] = (int)App::$Request->query->get('page');
208
+            $catSortParams['page'] = (int) App::$Request->query->get('page');
209 209
         }
210 210
         $catSortUrls = [
211 211
             'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false),
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         ];
225 225
 
226 226
         // check if this category is hidden
227
-        if ((int)$this->category['configs']['showCategory'] !== 1) {
227
+        if ((int) $this->category['configs']['showCategory'] !== 1) {
228 228
             throw new ForbiddenException(__('This category is not available to view'));
229 229
         }
230 230
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // check if current user can rate item
280 280
             $ignoredRate = App::$Session->get('content.rate.ignore');
281 281
             $canRate = true;
282
-            if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) {
282
+            if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) {
283 283
                 $canRate = false;
284 284
             }
285 285
             if (!App::$User->isAuth()) {
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                 'poster' => $row->getPosterUri(),
300 300
                 'thumb' => $row->getPosterThumbUri(),
301 301
                 'thumbSize' => File::size($row->getPosterThumbUri()),
302
-                'views' => (int)$row->views,
303
-                'rating' => (int)$row->rating,
302
+                'views' => (int) $row->views,
303
+                'rating' => (int) $row->rating,
304 304
                 'canRate' => $canRate,
305 305
                 'category' => $this->categories[$row->category_id],
306
-                'uri' => '/content/read/' . $itemPath,
306
+                'uri' => '/content/read/'.$itemPath,
307 307
                 'tags' => $tags
308 308
             ];
309 309
         }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Apps\Model\Front\Content;
4 4
 
5 5
 
6
-use Apps\ActiveRecord\Content;
7 6
 use Apps\ActiveRecord\Content as ContentRecord;
8 7
 use Apps\ActiveRecord\ContentCategory;
9 8
 use Apps\ActiveRecord\User;
Please login to merge, or discard this patch.
Apps/Model/Front/Sitemap/EntityBuildMap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
                 $this->data[$lang][] = [
53 53
                     'uri' => Url::standaloneUrl($uri, $lang),
54 54
                     'lastmod' => Date::convertToDatetime($lastmod, 'c'),
55
-                    'freq' => (string)$freq,
56
-                    'priority' => (float)$priority
55
+                    'freq' => (string) $freq,
56
+                    'priority' => (float) $priority
57 57
                 ];
58 58
             }
59 59
         } else { // only one language, multilanguage is disabled
60 60
             $this->data[App::$Properties->get('singleLanguage')][] = [
61 61
                 'uri' => Url::standaloneUrl($uri),
62 62
                 'lastmod' => Date::convertToDatetime($lastmod, 'c'),
63
-                'freq' => (string)$freq,
64
-                'priority' => (float)$priority
63
+                'freq' => (string) $freq,
64
+                'priority' => (float) $priority
65 65
             ];
66 66
         }
67 67
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 'items' => $items
87 87
             ]);
88 88
             
89
-            File::write(EntityIndexList::INDEX_PATH . '/' . $uniqueName . '.' . $lang . '.xml', $xml);
89
+            File::write(EntityIndexList::INDEX_PATH.'/'.$uniqueName.'.'.$lang.'.xml', $xml);
90 90
         }
91 91
         return true;
92 92
     }
Please login to merge, or discard this patch.