@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @var ActiveRecord $class |
| 63 | 63 | */ |
| 64 | 64 | $class = $class ?? $this->modelClass; |
| 65 | - $query = $this->getModelQuery($class)->andWhere(['id' => (int)$id]); |
|
| 65 | + $query = $this->getModelQuery($class)->andWhere([ 'id' => (int)$id ]); |
|
| 66 | 66 | $this->findModelCondition($query); |
| 67 | 67 | if (($model = $query->one()) !== null) { |
| 68 | 68 | return $model; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | ] |
| 89 | 89 | ], |
| 90 | 90 | ]; |
| 91 | - return new ActiveDataProvider(array_merge(['query' => $query], $options)); |
|
| 91 | + return new ActiveDataProvider(array_merge([ 'query' => $query ], $options)); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | 'verbs' => [ |
| 101 | 101 | 'class' => VerbFilter::class, |
| 102 | 102 | 'actions' => [ |
| 103 | - 'delete' => ['POST'], |
|
| 104 | - 'delete-batch' => ['POST'] |
|
| 103 | + 'delete' => [ 'POST' ], |
|
| 104 | + 'delete-batch' => [ 'POST' ] |
|
| 105 | 105 | ], |
| 106 | 106 | ], |
| 107 | 107 | ]); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function actionView($id) |
| 147 | 147 | { |
| 148 | 148 | if (Yii::$app->request->isPost) { |
| 149 | - return $this->runAction('update', ['id' => $this->id]); |
|
| 149 | + return $this->runAction('update', [ 'id' => $this->id ]); |
|
| 150 | 150 | } |
| 151 | 151 | return $this->render('view', [ |
| 152 | 152 | 'model' => $this->findModel($id), |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function createRedirect($model): array |
| 168 | 168 | { |
| 169 | - return ['index']; |
|
| 169 | + return [ 'index' ]; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function updateRedirect($model): array |
| 177 | 177 | { |
| 178 | - return ['index']; |
|
| 178 | + return [ 'index' ]; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function deleteRedirect($model): array |
| 186 | 186 | { |
| 187 | - return ['index']; |
|
| 187 | + return [ 'index' ]; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | public function run() |
| 18 | 18 | { |
| 19 | 19 | $ids = (array)Yii::$app->request->post('ids'); |
| 20 | - $errors = []; |
|
| 20 | + $errors = [ ]; |
|
| 21 | 21 | foreach ($ids as $id) { |
| 22 | - $this->controller->runAction('delete', ['id' => $id]); |
|
| 22 | + $this->controller->runAction('delete', [ 'id' => $id ]); |
|
| 23 | 23 | if (Yii::$app->session->hasFlash('error')) { |
| 24 | - $errors[] = Yii::$app->session->getFlash('error', null, true); |
|
| 24 | + $errors[ ] = Yii::$app->session->getFlash('error', null, true); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | if (!empty($errors)) { |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | return Yii::$app->response->redirect(Yii::$app->request->referrer, 302, false); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - return $this->controller->redirect(['index']); |
|
| 35 | + return $this->controller->redirect([ 'index' ]); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $this->controller->indexCondition($query); |
| 31 | 31 | $this->controller->applySearch($query, $dataProvider, $searchModel); |
| 32 | 32 | |
| 33 | - $params = $this->controller->indexParams(['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); |
|
| 33 | + $params = $this->controller->indexParams([ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider ]); |
|
| 34 | 34 | return $this->controller->render($this->controller->indexView ?: $this->view, $params); |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | \ No newline at end of file |
@@ -35,6 +35,6 @@ |
||
| 35 | 35 | } |
| 36 | 36 | Yii::$app->session->setFlash('error', Html::errorSummary($model)); |
| 37 | 37 | } |
| 38 | - return $this->controller->render($this->controller->createView ?: $this->view, ['model' => $model]); |
|
| 38 | + return $this->controller->render($this->controller->createView ?: $this->view, [ 'model' => $model ]); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | } |
| 33 | 33 | Yii::$app->session->setFlash('error', Html::errorSummary($model)); |
| 34 | 34 | } |
| 35 | - return $this->controller->render($this->controller->updateView ?: $this->view, ['model' => $model]); |
|
| 35 | + return $this->controller->render($this->controller->updateView ?: $this->view, [ 'model' => $model ]); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | protected static function actionToBreadcrumbClass($action) |
| 18 | 18 | { |
| 19 | 19 | $arr = explode('/', Inflector::camel2id($action->controller->getUniqueId())); |
| 20 | - $arr[\count($arr) - 1] = Inflector::camelize(ucfirst($arr[\count($arr) - 1])); |
|
| 21 | - return static::$crumbsNamespace . '\\' . implode('\\', $arr) . 'Crumbs'; |
|
| 20 | + $arr[ \count($arr) - 1 ] = Inflector::camelize(ucfirst($arr[ \count($arr) - 1 ])); |
|
| 21 | + return static::$crumbsNamespace.'\\'.implode('\\', $arr).'Crumbs'; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | protected static function actionToBreadcrumbMethod($action) |
| 25 | 25 | { |
| 26 | - return 'crumb' . Inflector::camelize($action->id); |
|
| 26 | + return 'crumb'.Inflector::camelize($action->id); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | if (class_exists($class) && method_exists($class, $method)) { |
| 40 | 40 | $reflectionMethod = new \ReflectionMethod($class, $method); |
| 41 | - $data = []; |
|
| 41 | + $data = [ ]; |
|
| 42 | 42 | foreach ($reflectionMethod->getParameters() as $p) { |
| 43 | - $data[] = $params[$p->getName()] ?? null; |
|
| 43 | + $data[ ] = $params[ $p->getName() ] ?? null; |
|
| 44 | 44 | } |
| 45 | - return array_filter(\call_user_func_array([$class, $method], $data)); |
|
| 45 | + return array_filter(\call_user_func_array([ $class, $method ], $data)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return []; |
|
| 48 | + return [ ]; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | \ No newline at end of file |