Skip to content

Commit

Permalink
docs: correct Syntax for phpDoc (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: githubjeka <etcoder@gmail.com>
  • Loading branch information
githubjeka and githubjeka authored Jan 14, 2022
1 parent 1749e22 commit 2fa057d
Show file tree
Hide file tree
Showing 30 changed files with 117 additions and 117 deletions.
4 changes: 2 additions & 2 deletions src/generators/controller/default/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\controller\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\controller\Generator $generator */

echo "<?php\n";
?>
Expand Down
8 changes: 4 additions & 4 deletions src/generators/controller/default/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* This is the template for generating an action view file.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\controller\Generator */
/* @var $action string the action ID */
/** @var yii\web\View $this */
/** @var yii\gii\generators\controller\Generator $generator */
/** @var string $action the action ID */

echo "<?php\n";
?>
/* @var $this yii\web\View */
/** @var yii\web\View $this */
<?= "?>" ?>

<h1><?= $generator->getControllerSubPath() . $generator->getControllerID() . '/' . $action ?></h1>
Expand Down
6 changes: 3 additions & 3 deletions src/generators/controller/form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\controller\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\controller\Generator $generator */

echo $form->field($generator, 'controllerClass');
echo $form->field($generator, 'actions');
Expand Down
4 changes: 2 additions & 2 deletions src/generators/crud/default/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use yii\helpers\StringHelper;


/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

$controllerClass = StringHelper::basename($generator->controllerClass);
$modelClass = StringHelper::basename($generator->modelClass);
Expand Down
4 changes: 2 additions & 2 deletions src/generators/crud/default/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use yii\helpers\StringHelper;


/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

$modelClass = StringHelper::basename($generator->modelClass);
$searchModelClass = StringHelper::basename($generator->searchModelClass);
Expand Down
10 changes: 5 additions & 5 deletions src/generators/crud/default/views/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

/* @var $model \yii\db\ActiveRecord */
$model = new $generator->modelClass();
Expand All @@ -19,9 +19,9 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->modelClass, '\\') ?> $model */
/** @var yii\widgets\ActiveForm $form */
?>

<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-form">
Expand Down
10 changes: 5 additions & 5 deletions src/generators/crud/default/views/_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->searchModelClass, '\\') ?> $model */
/** @var yii\widgets\ActiveForm $form */
?>

<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-search">
Expand Down
8 changes: 4 additions & 4 deletions src/generators/crud/default/views/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

echo "<?php\n";
?>

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->modelClass, '\\') ?> $model */

$this->title = <?= $generator->generateString('Create ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
Expand Down
10 changes: 5 additions & 5 deletions src/generators/crud/default/views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

$modelClass = StringHelper::basename($generator->modelClass);

Expand All @@ -17,9 +17,9 @@
use <?= $generator->indexWidgetType === 'grid' ? "yii\\grid\\GridView" : "yii\\widgets\\ListView" ?>;
<?= $generator->enablePjax ? 'use yii\widgets\Pjax;' : '' ?>

/* @var $this yii\web\View */
<?= !empty($generator->searchModelClass) ? "/* @var \$searchModel " . ltrim($generator->searchModelClass, '\\') . " */\n" : '' ?>
/* @var $dataProvider yii\data\ActiveDataProvider */
/** @var yii\web\View $this */
<?= !empty($generator->searchModelClass) ? "/** @var " . ltrim($generator->searchModelClass, '\\') . " \$searchModel */\n" : '' ?>
/** @var yii\data\ActiveDataProvider $dataProvider */

$this->title = <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
$this->params['breadcrumbs'][] = $this->title;
Expand Down
8 changes: 4 additions & 4 deletions src/generators/crud/default/views/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

$urlParams = $generator->generateUrlParams();
$modelClassName = Inflector::camel2words(StringHelper::basename($generator->modelClass));
Expand All @@ -21,8 +21,8 @@

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->modelClass, '\\') ?> $model */

$this->title = <?= $title ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
Expand Down
8 changes: 4 additions & 4 deletions src/generators/crud/default/views/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\crud\Generator $generator */

$urlParams = $generator->generateUrlParams();

Expand All @@ -14,8 +14,8 @@
use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->modelClass, '\\') ?> $model */

$this->title = $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
Expand Down
6 changes: 3 additions & 3 deletions src/generators/crud/form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\crud\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\crud\Generator $generator */

echo $form->field($generator, 'modelClass');
echo $form->field($generator, 'searchModelClass');
Expand Down
6 changes: 3 additions & 3 deletions src/generators/extension/form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\extension\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\extension\Generator $generator */

?>
<div class="alert alert-info">
Expand Down
4 changes: 2 additions & 2 deletions src/generators/form/default/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

use yii\helpers\Inflector;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\form\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\form\Generator $generator */

echo "<?php\n";
?>
Expand Down
10 changes: 5 additions & 5 deletions src/generators/form/default/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* This is the template for generating an action view file.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\form\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\form\Generator $generator */

$class = str_replace('/', '-', trim($generator->viewName, '_'));

Expand All @@ -14,9 +14,9 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form ActiveForm */
/** @var yii\web\View $this */
/** @var <?= ltrim($generator->modelClass, '\\') ?> $model */
/** @var ActiveForm $form */
<?= "?>" ?>

<div class="<?= $class ?>">
Expand Down
6 changes: 3 additions & 3 deletions src/generators/form/form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\form\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\form\Generator $generator */

echo $form->field($generator, 'viewName');
echo $form->field($generator, 'modelClass');
Expand Down
20 changes: 10 additions & 10 deletions src/generators/model/default/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* This is the template for generating the model class of a specified table.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\model\Generator */
/* @var $tableName string full table name */
/* @var $className string class name */
/* @var $queryClassName string query class name */
/* @var $tableSchema yii\db\TableSchema */
/* @var $properties array list of properties (property => [type, name. comment]) */
/* @var $labels string[] list of attribute labels (name => label) */
/* @var $rules string[] list of validation rules */
/* @var $relations array list of relations (name => relation declaration) */
/** @var yii\web\View $this */
/** @var yii\gii\generators\model\Generator $generator */
/** @var string $tableName full table name */
/** @var string $className class name */
/** @var string $queryClassName query class name */
/** @var yii\db\TableSchema $tableSchema */
/** @var array $properties list of properties (property => [type, name. comment]) */
/** @var string[] $labels list of attribute labels (name => label) */
/** @var string[] $rules list of validation rules */
/** @var array $relations list of relations (name => relation declaration) */

echo "<?php\n";
?>
Expand Down
20 changes: 10 additions & 10 deletions src/generators/model/default/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* This is the template for generating the ActiveQuery class.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\model\Generator */
/* @var $tableName string full table name */
/* @var $className string class name */
/* @var $tableSchema yii\db\TableSchema */
/* @var $labels string[] list of attribute labels (name => label) */
/* @var $rules string[] list of validation rules */
/* @var $relations array list of relations (name => relation declaration) */
/* @var $className string class name */
/* @var $modelClassName string related model class name */
/** @var yii\web\View $this */
/** @var yii\gii\generators\model\Generator $generator */
/** @var string $tableName full table name */
/** @var string $className class name */
/** @var yii\db\TableSchema $tableSchema */
/** @var string[] $labels list of attribute labels (name => label) */
/** @var string[] $rules list of validation rules */
/** @var array $relations list of relations (name => relation declaration) */
/** @var string $className class name */
/** @var string $modelClassName related model class name */

$modelFullClassName = $modelClassName;
if ($generator->ns !== $generator->queryNs) {
Expand Down
8 changes: 4 additions & 4 deletions src/generators/model/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
use yii\gii\generators\model\Generator;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\model\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\model\Generator $generator */

echo $form->field($generator, 'db');
echo $form->field($generator, 'useTablePrefix')->checkbox();
echo $form->field($generator, 'useSchemaName')->checkbox();
echo $form->field($generator, 'tableName')->textInput([
'autocomplete' => 'off',
'data' => [
'table-prefix' => $generator->getTablePrefix(),
'table-prefix' => $generator->getTablePrefix(),
'action' => Url::to(['default/action', 'id' => 'model', 'name' => 'GenerateClassName'])
]
]);
Expand Down
4 changes: 2 additions & 2 deletions src/generators/module/default/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* This is the template for generating a controller class within a module.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\module\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\module\Generator $generator */

echo "<?php\n";
?>
Expand Down
4 changes: 2 additions & 2 deletions src/generators/module/default/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* This is the template for generating a module class file.
*/

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\module\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\module\Generator $generator */

$className = $generator->moduleClass;
$pos = strrpos($className, '\\');
Expand Down
4 changes: 2 additions & 2 deletions src/generators/module/default/view.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\module\Generator */
/** @var yii\web\View $this */
/** @var yii\gii\generators\module\Generator $generator */
?>
<div class="<?= $generator->moduleID . '-default-index' ?>">
<h1><?= "<?= " ?>$this->context->action->uniqueId ?></h1>
Expand Down
6 changes: 3 additions & 3 deletions src/generators/module/form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $generator yii\gii\generators\module\Generator */
/** @var yii\web\View $this */
/** @var yii\widgets\ActiveForm $form */
/** @var yii\gii\generators\module\Generator $generator */

?>
<div class="module-form">
Expand Down
4 changes: 2 additions & 2 deletions src/views/default/diff.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* @var $this yii\web\View */
/* @var $diff mixed */
/** @var yii\web\View $this */
/** @var mixed $diff */
?>
<div class="default-diff">
<?php if ($diff === false): ?>
Expand Down
Loading

0 comments on commit 2fa057d

Please sign in to comment.