Passed
Pull Request — master (#1)
by Dmytro
04:37
created
modules/filter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
 use Asymptix\web\Request;
16 16
 
17 17
 // Set and Reset filter submit fields names may be changed.
18
-$setFilter = (bool) Request::getFieldValue('setFilter');
19
-$resetFilter = (bool) Request::getFieldValue('resetFilter');
18
+$setFilter = (bool)Request::getFieldValue('setFilter');
19
+$resetFilter = (bool)Request::getFieldValue('resetFilter');
20 20
 
21 21
 if (isset($_SESSION['_filter'])) {
22 22
     $_FILTER = unserialize($_SESSION['_filter']);
Please login to merge, or discard this patch.
modules/dbconnection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
         Config::getDBConfigParam('USER'), Config::getDBConfigParam('PASSWORD'),
21 21
         Config::getDBConfigParam('DBNAME'));
22 22
 if ($mysqli->connect_error) {
23
-    die('Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error);
23
+    die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
24 24
 } else {
25 25
     if (!$mysqli->set_charset(Config::getDBConfigParam('DB_CHARSET'))) {
26
-        printf('Error loading character set '.Config::getDBConfigParam('DB_CHARSET').": %s\n", $mysqli->error);
26
+        printf('Error loading character set ' . Config::getDBConfigParam('DB_CHARSET') . ": %s\n", $mysqli->error);
27 27
     }
28 28
 
29 29
     $manager = DBCore::getInstance();
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 }
34 34
 
35 35
 // Register a shutdown function which will close DB connection
36
-register_shutdown_function(function () {
36
+register_shutdown_function(function() {
37 37
     global $manager;
38 38
 
39 39
     $conns = $manager->getConnections();
Please login to merge, or discard this patch.
modules/http.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $paramsString = '';
26 26
         foreach ($params as $key => $value) {
27
-            $paramsString .= '&'.$key.'='.$value;
27
+            $paramsString .= '&' . $key . '=' . $value;
28 28
         }
29 29
         if ($session) {
30
-            $paramsString .= '&'.session_name().'='.session_id();
30
+            $paramsString .= '&' . session_name() . '=' . session_id();
31 31
         }
32 32
         $paramsString = substr($paramsString, 1);
33 33
         if ($paramsString) {
34
-            $paramsString = '?'.$paramsString;
34
+            $paramsString = '?' . $paramsString;
35 35
         }
36
-        header('Location: '.$url.$paramsString);
36
+        header('Location: ' . $url . $paramsString);
37 37
         exit();
38 38
     }
39 39
 }
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
                 case 505: $text = 'HTTP Version not supported';
126 126
                     break;
127 127
                 default:
128
-                    exit('Unknown http status code "'.htmlentities($code).'"');
128
+                    exit('Unknown http status code "' . htmlentities($code) . '"');
129 129
                     break;
130 130
             }
131 131
 
132 132
             $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
133 133
 
134
-            header($protocol.' '.$code.' '.$text);
134
+            header($protocol . ' ' . $code . ' ' . $text);
135 135
 
136 136
             $GLOBALS['http_response_code'] = $code;
137 137
         } else {
Please login to merge, or discard this patch.
modules/localization.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,4 +23,4 @@
 block discarded – undo
23 23
 $_LANG = Languages::getLanguage($_SESSION['lang']);
24 24
 $_SESSION['lang'] = $_LANG->code;
25 25
 
26
-require_once realpath(dirname(__FILE__)).'/../conf/langs/'.$_LANG->code.'.php';
26
+require_once realpath(dirname(__FILE__)) . '/../conf/langs/' . $_LANG->code . '.php';
Please login to merge, or discard this patch.
modules/error_log.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * @license http://opensource.org/licenses/MIT
14 14
  */
15
-register_shutdown_function(function () {
15
+register_shutdown_function(function() {
16 16
     $error = error_get_last();
17 17
 
18 18
     if ($error !== null) {
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
             $error['type'],
21 21
             $_SERVER['SCRIPT_NAME'],
22 22
             $error['file'],
23
-            (int) $error['line'],
23
+            (int)$error['line'],
24 24
             $error['message']
25 25
         );
26 26
     }
27 27
 });
28 28
 
29
-set_error_handler(function ($errno, $msg, $file, $line) {
29
+set_error_handler(function($errno, $msg, $file, $line) {
30 30
     \db\tools\ErrorLog::log(
31 31
         $errno,
32 32
         $_SERVER['SCRIPT_NAME'],
Please login to merge, or discard this patch.
modules/autoload.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
 
17 17
 $_PATH = $deepness > 0 ? implode('', array_fill(0, $deepness, '../')) : './';
18 18
 
19
-require_once $_PATH.'vendor/autoload.php';
20
-spl_autoload_register(function ($className) {
19
+require_once $_PATH . 'vendor/autoload.php';
20
+spl_autoload_register(function($className) {
21 21
     global $_PATH;
22 22
 
23 23
     $path = explode('\\', $className);
24 24
     if (in_array($path[0], ['conf'])) {
25
-        $includePath = $_PATH.str_replace('\\', '/', $className.'.php');
25
+        $includePath = $_PATH . str_replace('\\', '/', $className . '.php');
26 26
     } else {
27
-        $includePath = $_PATH.'classes/'.str_replace('\\', '/', $className.'.php');
27
+        $includePath = $_PATH . 'classes/' . str_replace('\\', '/', $className . '.php');
28 28
     }
29 29
     require_once $includePath;
30 30
 });
31 31
 
32
-require_once $_PATH.'modules/error_log.php';
32
+require_once $_PATH . 'modules/error_log.php';
Please login to merge, or discard this patch.
classes/Email.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
         return $this->sendNotification(
35 35
             Config::EMAIL_ADMIN,
36
-            "New user signup: '".$user->username."'",
36
+            "New user signup: '" . $user->username . "'",
37 37
             $_LANG->code,
38 38
             'signup_admin_email',
39 39
             [
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         global $_LANG;
62 62
 
63 63
         if (!Validator::isEmail($user->email)) {
64
-            throw new \Exception("Invalid email: '".$user->email."'");
64
+            throw new \Exception("Invalid email: '" . $user->email . "'");
65 65
         }
66 66
 
67 67
         return $this->sendNotification(
Please login to merge, or discard this patch.
classes/db/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     public function save()
25 25
     {
26
-        $query = 'INSERT INTO '.self::TABLE_NAME.' (setting_id, value) VALUES (?, ?)
26
+        $query = 'INSERT INTO ' . self::TABLE_NAME . ' (setting_id, value) VALUES (?, ?)
27 27
                   ON DUPLICATE KEY UPDATE value = ?';
28 28
 
29 29
         return DBCore::doUpdateQuery($query, 'sss', [
Please login to merge, or discard this patch.
classes/db/access/User.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function updateLoginTime()
122 122
     {
123
-        $query = 'UPDATE '.self::TABLE_NAME.'
123
+        $query = 'UPDATE ' . self::TABLE_NAME . '
124 124
                      SET last_login_time = NOW()
125
-                   WHERE '.self::ID_FIELD_NAME.' = ?';
125
+                   WHERE '.self::ID_FIELD_NAME . ' = ?';
126 126
         DBCore::doUpdateQuery($query, 'i', [$this->id]);
127 127
     }
128 128
 
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
     public function getAvatarPath($icon = false)
197 197
     {
198 198
         $currentAvatarFileName = $this->avatar;
199
-        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) {
200
-            return Config::DIR_AVATARS.$currentAvatarFileName;
199
+        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) {
200
+            return Config::DIR_AVATARS . $currentAvatarFileName;
201 201
         }
202 202
         if ($icon) {
203 203
             return 'img/user_avatar.png';
@@ -216,14 +216,14 @@  discard block
 block discarded – undo
216 216
     public function updateAvatar($newAvatarFileName)
217 217
     {
218 218
         $currentAvatarFileName = $this->avatar;
219
-        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) {
220
-            unlink(Config::DIR_AVATARS.$currentAvatarFileName);
219
+        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) {
220
+            unlink(Config::DIR_AVATARS . $currentAvatarFileName);
221 221
         }
222 222
 
223
-        if (file_exists(Config::DIR_AVATARS.$newAvatarFileName)) {
224
-            $query = 'UPDATE '.self::TABLE_NAME
223
+        if (file_exists(Config::DIR_AVATARS . $newAvatarFileName)) {
224
+            $query = 'UPDATE ' . self::TABLE_NAME
225 225
                     .' SET avatar = ?'
226
-                    .' WHERE '.self::ID_FIELD_NAME.' = ?';
226
+                    .' WHERE ' . self::ID_FIELD_NAME . ' = ?';
227 227
             if (DBCore::doUpdateQuery($query, 'si', [
228 228
                 $newAvatarFileName,
229 229
                 $this->id,
Please login to merge, or discard this patch.