Passed
Push — master ( 22651e...d2ef54 )
by Andrey
07:31
created
config/console.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 use Itstructure\AdminModule\Module as AdminModule;
4 4
 use Itstructure\MFUploader\Module as MFUModule;
5 5
 
6
-$params = require __DIR__ . '/params.php';
7
-$db = require __DIR__ . '/db.php';
6
+$params = require __DIR__.'/params.php';
7
+$db = require __DIR__.'/db.php';
8 8
 
9 9
 $config = [
10 10
     'id' => 'yii2-template-multilanguage-console',
11 11
     'basePath' => dirname(__DIR__),
12
-    'bootstrap' => ['log'],
12
+    'bootstrap' => [ 'log' ],
13 13
     'controllerNamespace' => 'app\commands',
14 14
     'aliases' => [
15 15
         '@bower' => '@vendor/bower-asset',
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             'targets' => [
32 32
                 [
33 33
                     'class' => 'yii\log\FileTarget',
34
-                    'levels' => ['error', 'warning'],
34
+                    'levels' => [ 'error', 'warning' ],
35 35
                 ],
36 36
             ],
37 37
         ],
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 
64 64
 if (YII_ENV_DEV) {
65 65
     // configuration adjustments for 'dev' environment
66
-    $config['bootstrap'][] = 'gii';
67
-    $config['modules']['gii'] = [
66
+    $config[ 'bootstrap' ][ ] = 'gii';
67
+    $config[ 'modules' ][ 'gii' ] = [
68 68
         'class' => 'yii\gii\Module',
69 69
     ];
70 70
 }
Please login to merge, or discard this patch.
config/admin/view-component.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,5 +9,5 @@
 block discarded – undo
9 9
     //'mainMenuConfig' => require __DIR__ . '/main-menu.php',
10 10
     'companyName' => 'Yii2 template',
11 11
     'shotCompanyName' => 'YTM',
12
-    'extraAssets' => require __DIR__ . '/extra-assets.php',
12
+    'extraAssets' => require __DIR__.'/extra-assets.php',
13 13
 ];
Please login to merge, or discard this patch.
config/test_db.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2
-$db = require __DIR__ . '/db.php';
2
+$db = require __DIR__.'/db.php';
3 3
 // test database! Important not to run tests on production or development databases
4
-$db['dsn'] = 'mysql:host=localhost;dbname=yii2_basic_tests';
4
+$db[ 'dsn' ] = 'mysql:host=localhost;dbname=yii2_basic_tests';
5 5
 
6 6
 return $db;
Please login to merge, or discard this patch.
config/test.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$params = require __DIR__ . '/params.php';
3
-$db = require __DIR__ . '/test_db.php';
2
+$params = require __DIR__.'/params.php';
3
+$db = require __DIR__.'/test_db.php';
4 4
 
5 5
 /**
6 6
  * Application configuration shared by all test types
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
             'useFileTransport' => true,
20 20
         ],
21 21
         'assetManager' => [
22
-            'basePath' => __DIR__ . '/../web/assets',
22
+            'basePath' => __DIR__.'/../web/assets',
23 23
         ],
24 24
         'urlManager' => [
25 25
             'showScriptName' => true,
Please login to merge, or discard this patch.
traits/ResponseTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         int $statusCode = 200): array {
53 53
 
54 54
         if (null === $data) {
55
-            $data = (object)[];
55
+            $data = (object)[ ];
56 56
         }
57 57
 
58 58
         \Yii::$app->response->statusCode = $statusCode;
Please login to merge, or discard this patch.
traits/AdminBeforeActionTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,24 +34,24 @@
 block discarded – undo
34 34
      */
35 35
     public function beforeAction($action)
36 36
     {
37
-        $this->view->mainMenuConfig = require __DIR__ . '/../config/admin/main-menu.php';
37
+        $this->view->mainMenuConfig = require __DIR__.'/../config/admin/main-menu.php';
38 38
 
39
-        $this->view->homeUrl = '/' . $this->shortLanguage . '/admin';
39
+        $this->view->homeUrl = '/'.$this->shortLanguage.'/admin';
40 40
 
41
-        $this->view->signOutLink = '/' . $this->shortLanguage . '/logout';
41
+        $this->view->signOutLink = '/'.$this->shortLanguage.'/logout';
42 42
 
43
-        $this->view->profileLink = '/' . $this->shortLanguage . '/admin/users/view?id='.Yii::$app->getUser()->id;
43
+        $this->view->profileLink = '/'.$this->shortLanguage.'/admin/users/view?id='.Yii::$app->getUser()->id;
44 44
 
45
-        Yii::$app->getUser()->loginUrl = '/' . $this->shortLanguage . '/login';
45
+        Yii::$app->getUser()->loginUrl = '/'.$this->shortLanguage.'/login';
46 46
 
47
-        $this->urlPrefix = '/' . $this->shortLanguage . '/' . $this->module->id . '/' . $action->controller->id . '/';
47
+        $this->urlPrefix = '/'.$this->shortLanguage.'/'.$this->module->id.'/'.$action->controller->id.'/';
48 48
 
49 49
         if (array_key_exists($action->controller->id, $this->neighborControllers)) {
50
-            $this->urlPrefixNeighbor = '/' . $this->shortLanguage . '/' . $this->module->id . '/' .
51
-                $this->neighborControllers[$action->controller->id] . '/';
50
+            $this->urlPrefixNeighbor = '/'.$this->shortLanguage.'/'.$this->module->id.'/'.
51
+                $this->neighborControllers[ $action->controller->id ].'/';
52 52
         }
53 53
 
54
-        $this->view->userBody = ArrayHelper::map($this->languages, 'name', function ($item) {
54
+        $this->view->userBody = ArrayHelper::map($this->languages, 'name', function($item) {
55 55
             /* @var Language $item */
56 56
             return BaseHelper::getSwitchLanguageLink($item->getShortName(), Yii::$app->request);
57 57
         });
Please login to merge, or discard this patch.
traits/LanguageTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
             '!=', 'shortName', $this->shortLanguage
42 42
         ])->all();
43 43
 
44
-        $this->view->params['languages'] = $this->languages;
44
+        $this->view->params[ 'languages' ] = $this->languages;
45 45
 
46
-        $this->view->params['shortLanguage'] = $this->shortLanguage;
46
+        $this->view->params[ 'shortLanguage' ] = $this->shortLanguage;
47 47
 
48 48
         parent::init();
49 49
     }
Please login to merge, or discard this patch.
helpers/BaseHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
         $urlArray = explode('/', $url);
41 41
 
42
-        $urlArray[0] = $newShortLanguage;
42
+        $urlArray[ 0 ] = $newShortLanguage;
43 43
 
44
-        return '/' . implode('/', $urlArray);
44
+        return '/'.implode('/', $urlArray);
45 45
     }
46 46
 
47 47
     /**
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public static function detectClientShortLanguage()
75 75
     {
76
-        if (!isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) || empty($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
76
+        if (!isset($_SERVER[ "HTTP_ACCEPT_LANGUAGE" ]) || empty($_SERVER[ "HTTP_ACCEPT_LANGUAGE" ])) {
77 77
             return null;
78 78
         }
79 79
 
80 80
         preg_match_all('/([a-z]{1,8}(?:-[a-z]{1,8})?)(?:;q=([0-9.]+))?/',
81
-            strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]),
81
+            strtolower($_SERVER[ "HTTP_ACCEPT_LANGUAGE" ]),
82 82
             $matches
83 83
         );
84 84
 
85
-        $langs = array_combine($matches[1], $matches[2]);
85
+        $langs = array_combine($matches[ 1 ], $matches[ 2 ]);
86 86
 
87 87
         foreach ($langs as $n => $v) {
88
-            $langs[$n] = $v ? $v : 1; // If no q, then set q = 1
88
+            $langs[ $n ] = $v ? $v : 1; // If no q, then set q = 1
89 89
         }
90 90
 
91 91
         arsort($langs); // Sort descending q
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
         $fields = array('HTTP_CLIENT_IP', 'HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR');
104 104
 
105 105
         $ip = "0.0.0.0";
106
-        foreach($fields as $k)
106
+        foreach ($fields as $k)
107 107
         {
108
-            if(!empty($_SERVER[$k]) && ip2long($_SERVER[$k]) != false)
108
+            if (!empty($_SERVER[ $k ]) && ip2long($_SERVER[ $k ]) != false)
109 109
             {
110
-                $ip = $_SERVER[$k];
110
+                $ip = $_SERVER[ $k ];
111 111
             }
112 112
         }
113 113
 
Please login to merge, or discard this patch.
helpers/InitialUserSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     private static function setUserStatus(TableSchema $settingsTableSchema, $settings, IdentityInterface $user): void
64 64
     {
65 65
         if (in_array('initUserStatus', $settingsTableSchema->columnNames)) {
66
-            $user->status = is_array($settings) && null !== $settings['initUserStatus'] ?
67
-                $settings['initUserStatus'] : self::INIT_USER_STATUS;
66
+            $user->status = is_array($settings) && null !== $settings[ 'initUserStatus' ] ?
67
+                $settings[ 'initUserStatus' ] : self::INIT_USER_STATUS;
68 68
             $user->save();
69 69
         } else {
70 70
             Yii::error('Field "initUserStatus" does not exists in "settings" table to set initial user status.');
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
                 ]);
94 94
             }
95 95
 
96
-            if (!is_array($settings) || null === $settings['initUserRole']) {
96
+            if (!is_array($settings) || null === $settings[ 'initUserRole' ]) {
97 97
                 $initUserRole = self::INIT_USER_ROLE;
98 98
                 Yii::error('Can not get field value of "initUserRole" from "settings" table to set initial user role.');
99 99
             } else {
100
-                $initUserRole = $settings['initUserRole'];
100
+                $initUserRole = $settings[ 'initUserRole' ];
101 101
             }
102 102
 
103 103
             $authManager->assign(
Please login to merge, or discard this patch.