From 77d9fad7012d977fd3eee050eb04e9959855827d Mon Sep 17 00:00:00 2001 From: sensorario Date: Mon, 6 May 2013 12:38:07 +0200 Subject: [PATCH 1/2] Removed unnecessary else --- framework/web/User.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/web/User.php b/framework/web/User.php index 88fc12d..e05d88a 100644 --- a/framework/web/User.php +++ b/framework/web/User.php @@ -460,8 +460,7 @@ class User extends Component $auth = Yii::$app->getAuthManager(); if ($auth !== null) { return $auth->checkAccess($this->getId(), $operation, $params); - } else { - return false; } + return false; } } From 249493985d440de71d77194052f980817e7f85fa Mon Sep 17 00:00:00 2001 From: sensorario Date: Fri, 18 Oct 2013 07:30:41 +0200 Subject: [PATCH 2/2] Convert to short syntax --- apps/basic/config/AppAsset.php | 12 ++++++------ apps/basic/config/console.php | 30 +++++++++++++++--------------- apps/basic/config/params.php | 4 ++-- apps/basic/config/web.php | 38 +++++++++++++++++++------------------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/apps/basic/config/AppAsset.php b/apps/basic/config/AppAsset.php index 3e22b9b..87f6f8b 100644 --- a/apps/basic/config/AppAsset.php +++ b/apps/basic/config/AppAsset.php @@ -17,13 +17,13 @@ class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; - public $css = array( + public $css = [ 'css/site.css', - ); - public $js = array( - ); - public $depends = array( + ]; + public $js = [ + ]; + public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', - ); + ]; } diff --git a/apps/basic/config/console.php b/apps/basic/config/console.php index 12f13cd..8d50bd2 100644 --- a/apps/basic/config/console.php +++ b/apps/basic/config/console.php @@ -1,25 +1,25 @@ 'bootstrap-console', 'basePath' => dirname(__DIR__), 'preload' => array('log'), 'controllerPath' => dirname(__DIR__) . '/commands', 'controllerNamespace' => 'app\commands', - 'modules' => array( - ), - 'components' => array( - 'cache' => array( + 'modules' => [ + ], + 'components' => [ + 'cache' => [ 'class' => 'yii\caching\FileCache', - ), - 'log' => array( - 'targets' => array( - array( + ], + 'log' => [ + 'targets' => [ + [ 'class' => 'yii\log\FileTarget', - 'levels' => array('error', 'warning'), - ), - ), - ), - ), + 'levels' => ['error', 'warning'], + ], + ], + ], + ], 'params' => $params, -); +]; diff --git a/apps/basic/config/params.php b/apps/basic/config/params.php index 398a1ce..93cb368 100644 --- a/apps/basic/config/params.php +++ b/apps/basic/config/params.php @@ -1,5 +1,5 @@ 'admin@example.com', -); +]; diff --git a/apps/basic/config/web.php b/apps/basic/config/web.php index e7d9420..6e4d2a1 100644 --- a/apps/basic/config/web.php +++ b/apps/basic/config/web.php @@ -1,33 +1,33 @@ 'bootstrap', 'basePath' => dirname(__DIR__), - 'components' => array( - 'request' => array( + 'components' => [ + 'request' => [ 'enableCsrfValidation' => true, - ), - 'cache' => array( + ], + 'cache' => [ 'class' => 'yii\caching\FileCache', - ), - 'user' => array( + ], + 'user' => [ 'identityClass' => 'app\models\User', - ), - 'errorHandler' => array( + ], + 'errorHandler' => [ 'errorAction' => 'site/error', - ), - 'log' => array( + ], + 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, - 'targets' => array( - array( + 'targets' => [ + [ 'class' => 'yii\log\FileTarget', - 'levels' => array('error', 'warning'), - ), - ), - ), - ), + 'levels' => ['error', 'warning'], + ], + ], + ], + ], 'params' => $params, -); +]; if (YII_ENV_DEV) { $config['preload'][] = 'debug';