Passed
Push — master ( 7068ce...7cf734 )
by Mihail
04:39
created
Apps/Model/Front/Search/SearchComments.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function __construct($query, $limit = 10)
27 27
     {
28 28
         $this->query = $query;
29
-        $this->limit = (int)$limit;
29
+        $this->limit = (int) $limit;
30 30
         if ($this->limit < 1) {
31 31
             $this->limit = 1;
32 32
         }
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
             $instance = new AbstractSearchResult();
62 62
             $instance->setTitle(App::$Translate->get('Search', 'Comment on the page'));
63 63
             $instance->setSnippet($snippet);
64
-            $instance->setUri($item->pathway . '#comments-list');
64
+            $instance->setUri($item->pathway.'#comments-list');
65 65
             $instance->setDate($item->created_at);
66
-            $instance->setRelevance((int)$item->relevance);
66
+            $instance->setRelevance((int) $item->relevance);
67 67
 
68 68
             // add instance to result set
69 69
             $result[] = $instance;
Please login to merge, or discard this patch.
Apps/Controller/Admin/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $query = new UserRecords();
41 41
 
42 42
         // set current page and offset
43
-        $page = (int)App::$Request->query->get('page', 0);
43
+        $page = (int) App::$Request->query->get('page', 0);
44 44
         $offset = $page * self::ITEM_PER_PAGE;
45 45
 
46 46
         // build pagination
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function actionDelete($id = null)
105 105
     {
106 106
         // check if id is passed or get data from GET as array ids
107
-        if ($id === 0 || (int)$id < 1) {
107
+        if ($id === 0 || (int) $id < 1) {
108 108
             $ids = App::$Request->query->get('selected');
109 109
             if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) {
110 110
                 $id = $ids;
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
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
             3 => ['text' => $user->login],
31 31
             4 => ['text' => $user->getRole()->name],
32 32
             5 => ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)],
33
-            6 => ['text' => Url::link(['user/update', $user->id], '<i class="fa fa-pencil fa-lg"></i>') .
33
+            6 => ['text' => Url::link(['user/update', $user->id], '<i class="fa fa-pencil fa-lg"></i>').
34 34
                 Url::link(['user/delete', $user->id], ' <i class="fa fa-trash-o fa-lg"></i>'),
35 35
                 'html' => true, 'property' => ['class' => 'text-center']],
36 36
             'property' => [
37
-                'class' => 'checkbox-row' . ($user->approve_token != '0' ? ' alert-warning' : null)
37
+                'class' => 'checkbox-row'.($user->approve_token != '0' ? ' alert-warning' : null)
38 38
             ]
39 39
         ];
40 40
     }
Please login to merge, or discard this patch.
Apps/View/Front/default/search/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $results = $model->getRelevanceSortedResult();
31 31
 
32 32
 if (!\Ffcms\Core\Helper\Type\Obj::isArray($results) || count($results) < 1) {
33
-    echo '<p class="alert alert-warning">' . __('Matches not founded') . '</p>';
33
+    echo '<p class="alert alert-warning">'.__('Matches not founded').'</p>';
34 34
     return;
35 35
 }
36 36
 ?>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     <div class="col-md-12">
41 41
         <div class="search-result">
42 42
             <div class="h4">
43
-                <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"><?= $model->highlightText($item['title'], 'span', ['class' => 'search-highlight']) ?></a>
43
+                <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"><?= $model->highlightText($item['title'], 'span', ['class' => 'search-highlight']) ?></a>
44 44
                 <small class="pull-right"><?= $item['date'] ?></small>
45 45
             </div>
46 46
             <small><?= $model->highlightText($item['snippet'], 'span', ['class' => 'search-highlight']) ?>...</small>
Please login to merge, or discard this patch.
Apps/View/Admin/default/main/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
                         $class = 'label-danger';
66 66
                         $tooltip = __('Location: %loc%. Required permissions: +rw', ['loc' => $dir]);
67 67
                     }
68
-                    echo '<span class="label ' . $class . '" data-toggle="tooltip" title="' . $tooltip . '">' . $dir . '</span> ';
68
+                    echo '<span class="label '.$class.'" data-toggle="tooltip" title="'.$tooltip.'">'.$dir.'</span> ';
69 69
                 }
70 70
                 ?>
71 71
                 <hr />
Please login to merge, or discard this patch.
Apps/Model/Front/User/FormRegister.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,11 +4,9 @@
 block discarded – undo
4 4
 
5 5
 use Apps\ActiveRecord\Profile;
6 6
 use Apps\ActiveRecord\User;
7
-use Apps\Model\Front\User\FormLogin;
8 7
 use Ffcms\Core\App;
9 8
 use Ffcms\Core\Arch\Model;
10 9
 use Ffcms\Core\Helper\Type\Str;
11
-use Ffcms\Core\Interfaces\iUser;
12 10
 
13 11
 class FormRegister extends Model
14 12
 {
Please login to merge, or discard this patch.
Apps/Model/Front/User/FormSocialAuth.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@
 block discarded – undo
44 44
     }
45 45
 
46 46
     /**
47
-    * Parse user identifier to attributes
48
-    */
47
+     * Parse user identifier to attributes
48
+     */
49 49
     public function before()
50 50
     {
51 51
         // set unique user id from provider response
Please login to merge, or discard this 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.