Completed
Push — master ( 355512...245527 )
by Tobias
12:24 queued 12s
created
src/views/layouts/main.php 1 patch
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,15 +10,14 @@
 block discarded – undo
10 10
  * file that was distributed with this source code.
11 11
  */
12 12
 
13
+use Yii;
13 14
 use dmstr\helpers\SettingsAsset;
14 15
 use dmstr\modules\backend\widgets\Modal;
15 16
 use dmstr\modules\backend\widgets\Toolbar;
16 17
 use dmstr\modules\prototype\widgets\TwigWidget;
17 18
 use hrzg\widget\widgets\Cell;
18 19
 use lo\modules\noty\Wrapper;
19
-use Yii;
20 20
 use yii\helpers\Html;
21
-use yii\helpers\Url;
22 21
 use yii\widgets\Pjax;
23 22
 
24 23
 /* @var $this \yii\web\View */
Please login to merge, or discard this patch.
config/main.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 use Yii;
15 15
 
16 16
 // PHP Constants
17
-$version = is_file(__DIR__ . '/../version') ? trim(file_get_contents(__DIR__ . '/../version')) : 'dev';
17
+$version = is_file(__DIR__.'/../version') ? trim(file_get_contents(__DIR__.'/../version')) : 'dev';
18 18
 defined('APP_VERSION') or define('APP_VERSION', $version);
19 19
 $projectVersion = is_file(__DIR__.'/../../project/version') ? trim(file_get_contents(__DIR__.'/../../project/version')) : 'vanilla';
20 20
 defined('PROJECT_VERSION') or define('PROJECT_VERSION', $projectVersion);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 Yii::setAlias('@webroot', '@root/web');
28 28
 
29 29
 // Use a closure to not pollute the global namespace
30
-return call_user_func(function () {
30
+return call_user_func(function() {
31 31
 
32 32
     /*function checkFile(){
33 33
         if (file_exists($file)) {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         "{$configDir}/".APP_TYPE.'.php' => true,
42 42
         "{$configDir}/common-".YII_ENV.'.php' => false,
43 43
         "{$configDir}/".APP_TYPE.'-'.YII_ENV.'.php' => false,
44
-        "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false,
44
+        "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG) ? 'debug' : 'release').'.php' => false,
45 45
     ];
46 46
 
47 47
     if (!empty(getenv('APP_CONFIG_FILE'))) {
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         // Merge additional configurations
50 50
         foreach ($additionalConfigFiles as $alias) {
51 51
             $file = Yii::getAlias($alias);
52
-            $configFiles[$file] = true;
52
+            $configFiles[ $file ] = true;
53 53
         }
54 54
     }
55 55
 
56 56
     // Merge configurations
57
-    $config = [];
57
+    $config = [ ];
58 58
     //var_dump($configFiles);exit;
59 59
     Yii::trace($configFiles, __METHOD__);
60 60
     foreach ($configFiles as $file => $isRequired) {
Please login to merge, or discard this patch.
config/common.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 $languages = explode(',', getenv('APP_LANGUAGES'));
21 21
 
22 22
 // prepare asset bundle config
23
-$bundles = [];
23
+$bundles = [ ];
24 24
 if (getenv('APP_ASSET_USE_BUNDLED')) {
25 25
     // include generated asset-bundle configuration
26
-    $bundles = include Yii::getAlias('@web/bundles') . '/config.php';
26
+    $bundles = include Yii::getAlias('@web/bundles').'/config.php';
27 27
     // disable loading of bundles skin file, when using bundled assets
28 28
     Yii::$container->set(
29 29
         AdminLteAsset::className(),
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 return [
66 66
     'id' => 'app',
67 67
     'name' => getenv('APP_TITLE'),
68
-    'language' => $languages[0],
68
+    'language' => $languages[ 0 ],
69 69
     'basePath' => '@app',
70 70
     'vendorPath' => '@root/vendor',
71 71
     'runtimePath' => '@root/runtime',
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     ],
84 84
     'params' => [
85 85
         'adminEmail' => getenv('APP_ADMIN_EMAIL'),
86
-        'context.menuItems' => [],
86
+        'context.menuItems' => [ ],
87 87
         'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self',
88 88
         'backend.browserSupport' => [
89 89
             'Chrome' => 72,
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         ],
109 109
         'authManager' => [
110 110
             'class' => \yii\rbac\DbManager::class,
111
-            'defaultRoles' => ['Default'],
111
+            'defaultRoles' => [ 'Default' ],
112 112
             'cache' => 'cache'
113 113
         ],
114 114
         'cache' =>
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'),
135 135
             'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'),
136 136
             'bucket' => getenv('AMAZON_S3_BUCKET_NAME'),
137
-            'prefix' => getenv('APP_NAME') . '/public',
137
+            'prefix' => getenv('APP_NAME').'/public',
138 138
             'region' => getenv('AMAZON_S3_BUCKET_REGION'),
139 139
         ],
140 140
         'fsRuntime' => [
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
                 'common' => [
161 161
                     'class' => \codemix\streamlog\Target::class,
162 162
                     'url' => 'php://stderr',
163
-                    'levels' => ['error', 'warning'],
164
-                    'logVars' => [],
163
+                    'levels' => [ 'error', 'warning' ],
164
+                    'logVars' => [ ],
165 165
                     'replaceNewline' => (APP_TYPE == 'console') ? null : '',
166 166
                 ],
167 167
             ],
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
         'user' => [
197 197
             'class' => \dmstr\web\User::class,
198 198
             'enableAutoLogin' => true,
199
-            'loginUrl' => ['/user/security/login'],
199
+            'loginUrl' => [ '/user/security/login' ],
200 200
             'identityClass' => Da\User\Model\User::class,
201
-            'rootUsers' => ['admin'],
201
+            'rootUsers' => [ 'admin' ],
202 202
         ],
203 203
         'urlManager' => [
204 204
             'class' => \codemix\localeurls\UrlManager::class,
@@ -229,32 +229,32 @@  discard block
 block discarded – undo
229 229
                         'auto_reload' => true,
230 230
                     ],
231 231
                     'globals' => [
232
-                        'Html' => ['class' => \yii\helpers\Html::class],
233
-                        'Json' => ['class' => \yii\helpers\Json::class],
234
-                        'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class],
235
-                        'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class],
236
-                        'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class],
237
-                        'Url' => ['class' => \yii\helpers\Url::class],
238
-                        'Markdown' => ['class' => \yii\helpers\Markdown::class],
232
+                        'Html' => [ 'class' => \yii\helpers\Html::class ],
233
+                        'Json' => [ 'class' => \yii\helpers\Json::class ],
234
+                        'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ],
235
+                        'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ],
236
+                        'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ],
237
+                        'Url' => [ 'class' => \yii\helpers\Url::class ],
238
+                        'Markdown' => [ 'class' => \yii\helpers\Markdown::class ],
239 239
                     ],
240 240
                     'functions' => [
241
-                        'image' => function ($imageSource, $preset = null) {
241
+                        'image' => function($imageSource, $preset = null) {
242 242
                             // preset example, when using imageproxy, https://github.com/willnorris/imageproxy#examples
243 243
                             if (getenv('IMAGEPROXY_SIGNATURE_KEY')) {
244 244
                                 $key = getenv('IMAGEPROXY_SIGNATURE_KEY');
245
-                                $preset .= ',s' . strtr(
245
+                                $preset .= ',s'.strtr(
246 246
                                     base64_encode(hash_hmac('sha256', $imageSource, $key, 1)),
247 247
                                     '/+',
248 248
                                     '_-'
249 249
                                 );
250 250
                             }
251
-                            return Yii::$app->settings->get('imgBaseUrl', 'app.frontend') .
252
-                                $preset .
253
-                                Yii::$app->settings->get('imgHostPrefix', 'app.frontend') .
254
-                                $imageSource .
251
+                            return Yii::$app->settings->get('imgBaseUrl', 'app.frontend').
252
+                                $preset.
253
+                                Yii::$app->settings->get('imgHostPrefix', 'app.frontend').
254
+                                $imageSource.
255 255
                                 Yii::$app->settings->get('imgHostSuffix', 'app.frontend');
256 256
                         },
257
-                        't' => function ($category, $message) {
257
+                        't' => function($category, $message) {
258 258
                             return Yii::t($category, $message);
259 259
                         },
260 260
                     ],
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     'modules' => [
269 269
         'audit' => [
270 270
             'class' => \bedezign\yii2\audit\Audit::class,
271
-            'accessRoles' => ['audit-module'],
271
+            'accessRoles' => [ 'audit-module' ],
272 272
             'layout' => $boxLayout,
273 273
             'panels' => [
274 274
                 'audit/trail' => [
@@ -349,12 +349,12 @@  discard block
 block discarded – undo
349 349
                 [
350 350
                     'connection' => 'db',
351 351
                     'table' => '{{%hrzg_widget_template}}',
352
-                    'columns' => ['twig_template']
352
+                    'columns' => [ 'twig_template' ]
353 353
                 ],
354 354
                 [
355 355
                     'connection' => 'db',
356 356
                     'table' => '{{%twig}}',
357
-                    'columns' => ['value']
357
+                    'columns' => [ 'value' ]
358 358
                 ]
359 359
             ],
360 360
             'scanners' => [
@@ -363,15 +363,15 @@  discard block
 block discarded – undo
363 363
                 ScannerJavaScriptFunction::class,
364 364
                 ScannerDatabase::class
365 365
             ],
366
-            'allowedIPs' => ['*'],
367
-            'roles' => ['translate-module'],
366
+            'allowedIPs' => [ '*' ],
367
+            'roles' => [ 'translate-module' ],
368 368
         ],
369 369
         'user' => [
370 370
             'class' => Da\User\Module::class,
371 371
             'layout' => '@app/views/layouts/container',
372 372
             'defaultRoute' => 'admin',
373 373
             'administratorPermissionName' => 'user-module',
374
-            'administrators' => ['admin'],
374
+            'administrators' => [ 'admin' ],
375 375
             'enableFlashMessages' => false,
376 376
             'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'),
377 377
             'mailParams' => [
Please login to merge, or discard this patch.
config/env.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 
16 16
 // Load default settings via dotenv from file, load local environment first, if available
17 17
 if (getenv('ENV_LOCAL_FILE')) {
18
-    $localEnv = FileHelper::normalizePath($configPath . '/' . getenv('ENV_LOCAL_FILE'));
18
+    $localEnv = FileHelper::normalizePath($configPath.'/'.getenv('ENV_LOCAL_FILE'));
19 19
     if (is_file($localEnv)) {
20 20
         $dotenvLocal = new Dotenv\Dotenv($configPath, getenv('ENV_LOCAL_FILE'));
21 21
         $dotenvLocal->load();
22 22
     } else {
23
-        exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found" . PHP_EOL);
23
+        exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found".PHP_EOL);
24 24
     }
25 25
 }
26 26
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 $dotenv->load();
30 30
 
31 31
 // Basic checks & validation
32
-$dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]);
33
-$dotenv->required('YII_ENV', ['dev', 'prod', 'test']);
32
+$dotenv->required('YII_DEBUG', [ '', '0', '1', 'true', true ]);
33
+$dotenv->required('YII_ENV', [ 'dev', 'prod', 'test' ]);
34 34
 $dotenv->required([
35 35
     'YII_TRACE_LEVEL',
36 36
     'APP_NAME',
Please login to merge, or discard this patch.
web/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@  discard block
 block discarded – undo
3 3
 // Prepare environment
4 4
 $rootPath = realpath(__DIR__.'/..');
5 5
 require($rootPath.'/vendor/autoload.php');
6
-require($rootPath . '/config/env.php');
6
+require($rootPath.'/config/env.php');
7 7
 
8 8
 // Define framework & application constants
9
-defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG'));
9
+defined('YII_DEBUG') or define('YII_DEBUG', (boolean) getenv('YII_DEBUG'));
10 10
 defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
11 11
 defined('APP_TYPE') or define('APP_TYPE', 'web');
12 12
 
@@ -22,4 +22,4 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 // Run application
25
-(new yii\web\Application(require($rootPath . '/config/main.php')))->run();
25
+(new yii\web\Application(require($rootPath.'/config/main.php')))->run();
Please login to merge, or discard this patch.