Commit 7c75b9bc by Luciano Baraglia

GII generated files changes according to PSR2

parent dbc6d106
...@@ -70,7 +70,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas ...@@ -70,7 +70,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/** /**
* Displays a single <?= $modelClass ?> model. * Displays a single <?= $modelClass ?> model.
* <?= implode("\n\t * ", $actionParamComments) . "\n" ?> * <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed * @return mixed
*/ */
public function actionView(<?= $actionParams ?>) public function actionView(<?= $actionParams ?>)
...@@ -101,7 +101,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas ...@@ -101,7 +101,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/** /**
* Updates an existing <?= $modelClass ?> model. * Updates an existing <?= $modelClass ?> model.
* If update is successful, the browser will be redirected to the 'view' page. * If update is successful, the browser will be redirected to the 'view' page.
* <?= implode("\n\t * ", $actionParamComments) . "\n" ?> * <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed * @return mixed
*/ */
public function actionUpdate(<?= $actionParams ?>) public function actionUpdate(<?= $actionParams ?>)
...@@ -120,7 +120,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas ...@@ -120,7 +120,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/** /**
* Deletes an existing <?= $modelClass ?> model. * Deletes an existing <?= $modelClass ?> model.
* If deletion is successful, the browser will be redirected to the 'index' page. * If deletion is successful, the browser will be redirected to the 'index' page.
* <?= implode("\n\t * ", $actionParamComments) . "\n" ?> * <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed * @return mixed
*/ */
public function actionDelete(<?= $actionParams ?>) public function actionDelete(<?= $actionParams ?>)
...@@ -133,7 +133,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas ...@@ -133,7 +133,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/** /**
* Finds the <?= $modelClass ?> model based on its primary key value. * Finds the <?= $modelClass ?> model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
* <?= implode("\n\t * ", $actionParamComments) . "\n" ?> * <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return <?= $modelClass ?> the loaded model * @return <?= $modelClass ?> the loaded model
* @throws NotFoundHttpException if the model cannot be found * @throws NotFoundHttpException if the model cannot be found
*/ */
......
...@@ -33,12 +33,12 @@ use <?= ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelA ...@@ -33,12 +33,12 @@ use <?= ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelA
*/ */
class <?= $searchModelClass ?> extends Model class <?= $searchModelClass ?> extends Model
{ {
public $<?= implode(";\n\tpublic $", $searchAttributes) ?>; public $<?= implode(";\n public $", $searchAttributes) ?>;
public function rules() public function rules()
{ {
return [ return [
<?= implode(",\n\t\t\t", $rules) ?>, <?= implode(",\n ", $rules) ?>,
]; ];
} }
...@@ -65,7 +65,7 @@ class <?= $searchModelClass ?> extends Model ...@@ -65,7 +65,7 @@ class <?= $searchModelClass ?> extends Model
return $dataProvider; return $dataProvider;
} }
<?= implode("\n\t\t", $searchConditions) ?> <?= implode("\n ", $searchConditions) ?>
return $dataProvider; return $dataProvider;
} }
......
...@@ -33,11 +33,11 @@ use yii\widgets\ActiveForm; ...@@ -33,11 +33,11 @@ use yii\widgets\ActiveForm;
<?= "<?php " ?>$form = ActiveForm::begin(); ?> <?= "<?php " ?>$form = ActiveForm::begin(); ?>
<?php foreach ($safeAttributes as $attribute) { <?php foreach ($safeAttributes as $attribute) {
echo "\t\t<?= " . $generator->generateActiveField($attribute) . " ?>\n\n"; echo " <?= " . $generator->generateActiveField($attribute) . " ?>\n\n";
} ?> } ?>
<div class="form-group"> <div class="form-group">
<?= "<?= " ?>Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> <?= "<?= " ?>Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div> </div>
<?= "<?php " ?>ActiveForm::end(); ?> <?= "<?php " ?>ActiveForm::end(); ?>
......
...@@ -32,16 +32,16 @@ use yii\widgets\ActiveForm; ...@@ -32,16 +32,16 @@ use yii\widgets\ActiveForm;
$count = 0; $count = 0;
foreach ($generator->getColumnNames() as $attribute) { foreach ($generator->getColumnNames() as $attribute) {
if (++$count < 6) { if (++$count < 6) {
echo "\t\t<?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n"; echo " <?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
} else { } else {
echo "\t\t<?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n"; echo " <?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
} }
} }
?> ?>
<div class="form-group"> <div class="form-group">
<?= "<?= " ?>Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= "<?= " ?>Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= "<?= " ?>Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> <?= "<?= " ?>Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div> </div>
<?= "<?php " ?>ActiveForm::end(); ?> <?= "<?php " ?>ActiveForm::end(); ?>
......
...@@ -48,18 +48,18 @@ $count = 0; ...@@ -48,18 +48,18 @@ $count = 0;
if (($tableSchema = $generator->getTableSchema()) === false) { if (($tableSchema = $generator->getTableSchema()) === false) {
foreach ($generator->getColumnNames() as $name) { foreach ($generator->getColumnNames() as $name) {
if (++$count < 6) { if (++$count < 6) {
echo "\t\t\t'" . $name . "',\n"; echo " '" . $name . "',\n";
} else { } else {
echo "\t\t\t// '" . $name . "',\n"; echo " // '" . $name . "',\n";
} }
} }
} else { } else {
foreach ($tableSchema->columns as $column) { foreach ($tableSchema->columns as $column) {
$format = $generator->generateColumnFormat($column); $format = $generator->generateColumnFormat($column);
if (++$count < 6) { if (++$count < 6) {
echo "\t\t\t'" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n"; echo " '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
} else { } else {
echo "\t\t\t// '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n"; echo " // '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
} }
} }
} }
......
...@@ -46,12 +46,12 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -46,12 +46,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php <?php
if (($tableSchema = $generator->getTableSchema()) === false) { if (($tableSchema = $generator->getTableSchema()) === false) {
foreach ($generator->getColumnNames() as $name) { foreach ($generator->getColumnNames() as $name) {
echo "\t\t\t'" . $name . "',\n"; echo " '" . $name . "',\n";
} }
} else { } else {
foreach ($generator->getTableSchema()->columns as $column) { foreach ($generator->getTableSchema()->columns as $column) {
$format = $generator->generateColumnFormat($column); $format = $generator->generateColumnFormat($column);
echo "\t\t\t'" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n"; echo " '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
} }
} }
?> ?>
......
...@@ -45,7 +45,7 @@ class <?= $className ?> extends <?= '\\' . ltrim($generator->baseClass, '\\') . ...@@ -45,7 +45,7 @@ class <?= $className ?> extends <?= '\\' . ltrim($generator->baseClass, '\\') .
*/ */
public function rules() public function rules()
{ {
return [<?= "\n\t\t\t" . implode(",\n\t\t\t", $rules) . "\n\t\t" ?>]; return [<?= "\n " . implode(",\n ", $rules) . "\n " ?>];
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment