Skip to content

fixed everything to be psr2 compatible (php-cs-fixer) #2743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions apps/advanced/backend/assets/AppAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = ['css/site.css'];
public $js = [];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = ['css/site.css'];
public $js = [];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
56 changes: 28 additions & 28 deletions apps/advanced/backend/config/main.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);

return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'preload' => ['log'],
'controllerNamespace' => 'backend\controllers',
'modules' => [],
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'preload' => ['log'],
'controllerNamespace' => 'backend\controllers',
'modules' => [],
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
];
2 changes: 1 addition & 1 deletion apps/advanced/backend/config/params.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
return [
'adminEmail' => '[email protected]',
'adminEmail' => '[email protected]',
];
125 changes: 63 additions & 62 deletions apps/advanced/backend/controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,71 +12,72 @@
*/
class SiteController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
],
],
];
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
],
],
];
}

/**
* @inheritdoc
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
/**
* @inheritdoc
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}

public function actionIndex()
{
return $this->render('index');
}
public function actionIndex()
{
return $this->render('index');
}

public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}

$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}

public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
public function actionLogout()
{
Yii::$app->user->logout();

return $this->goHome();
}
}
16 changes: 8 additions & 8 deletions apps/advanced/backend/tests/_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* application configurations shared by all test types
*/
return [
'components' => [
'mail' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
],
],
'components' => [
'mail' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
],
],
];
2 changes: 1 addition & 1 deletion apps/advanced/backend/tests/_helpers/CodeHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Codeception\Module;

// here you can define custom functions for CodeGuy
// here you can define custom functions for CodeGuy

class CodeHelper extends \Codeception\Module
{
Expand Down
2 changes: 1 addition & 1 deletion apps/advanced/backend/tests/_helpers/TestHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Codeception\Module;

// here you can define custom functions for TestGuy
// here you can define custom functions for TestGuy

class TestHelper extends \Codeception\Module
{
Expand Down
2 changes: 1 addition & 1 deletion apps/advanced/backend/tests/_helpers/WebHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Codeception\Module;

// here you can define custom functions for WebGuy
// here you can define custom functions for WebGuy

class WebHelper extends \Codeception\Module
{
Expand Down
2 changes: 1 addition & 1 deletion apps/advanced/backend/tests/acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ modules:
- common\tests\_helpers\FixtureHelper
# you can use WebDriver instead of PhpBrowser to test javascript and ajax.
# This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium
# "restart" option is used by the WebDriver to start each time per test-file new session and cookies,
# "restart" option is used by the WebDriver to start each time per test-file new session and cookies,
# it is useful if you want to login in your app in each test.
# - WebDriver
config:
Expand Down
24 changes: 12 additions & 12 deletions apps/advanced/backend/tests/acceptance/_config.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../config/main.php'),
require(__DIR__ . '/../../config/main-local.php'),
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
require(__DIR__ . '/../../config/main.php'),
require(__DIR__ . '/../../config/main-local.php'),
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
);
22 changes: 11 additions & 11 deletions apps/advanced/backend/tests/acceptance/_console.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../../../console/config/main.php'),
require(__DIR__ . '/../../../console/config/main-local.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../../../console/config/main.php'),
require(__DIR__ . '/../../../console/config/main-local.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
);
24 changes: 12 additions & 12 deletions apps/advanced/backend/tests/functional/_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
$_SERVER['SCRIPT_NAME'] = TEST_ENTRY_URL;

return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../config/main.php'),
require(__DIR__ . '/../../config/main-local.php'),
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
require(__DIR__ . '/../../config/main.php'),
require(__DIR__ . '/../../config/main-local.php'),
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
);
22 changes: 11 additions & 11 deletions apps/advanced/backend/tests/functional/_console.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../../../console/config/main.php'),
require(__DIR__ . '/../../../console/config/main-local.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../../../console/config/main.php'),
require(__DIR__ . '/../../../console/config/main-local.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
);
Loading