for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace modules\rbac\controllers;
use Yii;
use yii\helpers\Url;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use modules\rbac\Module;
/**
* Class DefaultController
* @package modules\rbac\controllers
*/
class DefaultController extends \modules\rbac\console\InitController
{
* @inheritdoc
* @return array
public function behaviors()
return [
'access' => [
'class' => AccessControl::className(),
yii\base\BaseObject::className()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
'class' => /** @scrutinizer ignore-deprecated */ AccessControl::className(),
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
'rules' => [
[
'allow' => true,
'roles' => ['managerRbac'],
],
'verbs' => [
'class' => VerbFilter::className(),
'class' => /** @scrutinizer ignore-deprecated */ VerbFilter::className(),
'actions' => [
'init' => YII_ENV_TEST ? ['GET'] : ['POST'],
];
}
* Renders the index view for the module
* @return mixed
public function actionIndex()
return $this->render('index');
* Переинициализация RBAC
* с установкой настроек по умолчанию
public function actionInit()
if ($this->processInit()) {
Yii::$app->session->setFlash('success', Module::t('module', 'The operation was successful!'));
Yii::$app->getResponse()->redirect(Url::to(['index']));
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.