From b0b1c27c859d2c69ffa755cd97b5a39fecde8202 Mon Sep 17 00:00:00 2001 From: slavcodev Date: Tue, 12 Nov 2013 06:21:04 +0200 Subject: [PATCH] Fix phpDoc var tag format --- extensions/gii/views/default/index.php | 8 ++++---- extensions/gii/views/default/view/files.php | 4 ++-- extensions/gii/views/layouts/generator.php | 8 ++++---- extensions/gii/views/layouts/main.php | 4 ++-- extensions/swiftmailer/Message.php | 2 +- framework/yii/BaseYii.php | 2 +- framework/yii/base/Application.php | 2 -- framework/yii/base/Model.php | 3 +-- framework/yii/base/Module.php | 2 +- framework/yii/base/View.php | 2 +- .../yii/console/controllers/CacheController.php | 2 +- framework/yii/db/ActiveQuery.php | 6 +++--- framework/yii/db/ActiveRecord.php | 10 +++++----- framework/yii/db/ActiveRelation.php | 8 ++++---- framework/yii/db/Command.php | 2 +- framework/yii/db/Schema.php | 4 ++-- framework/yii/log/Target.php | 2 +- framework/yii/rbac/PhpManager.php | 20 ++++++++++---------- framework/yii/requirements/requirements.php | 2 +- framework/yii/requirements/views/console/index.php | 6 +++--- framework/yii/requirements/views/web/index.php | 6 +++--- framework/yii/validators/ExistValidator.php | 4 ++-- framework/yii/validators/UniqueValidator.php | 2 +- framework/yii/web/AccessControl.php | 2 +- framework/yii/web/UrlManager.php | 6 +++--- framework/yii/web/User.php | 4 ++-- framework/yii/widgets/ActiveForm.php | 2 +- tests/unit/data/views/layout.php | 6 +++--- tests/unit/data/views/rawlayout.php | 4 ++-- tests/unit/extensions/swiftmailer/MessageTest.php | 2 +- tests/unit/framework/db/ActiveRecordTest.php | 6 +++--- tests/unit/framework/validators/ValidatorTest.php | 4 ++-- 32 files changed, 72 insertions(+), 75 deletions(-) diff --git a/extensions/gii/views/default/index.php b/extensions/gii/views/default/index.php index f6d6855..2e48816 100644 --- a/extensions/gii/views/default/index.php +++ b/extensions/gii/views/default/index.php @@ -2,10 +2,10 @@ use yii\helpers\Html; /** - * @var $this \yii\web\View - * @var $content string - * @var yii\gii\Generator[] $generators - * @var yii\gii\Generator $activeGenerator + * @var \yii\web\View $this + * @var \yii\gii\Generator[] $generators + * @var \yii\gii\Generator $activeGenerator + * @var string $content */ $generators = Yii::$app->controller->module->generators; $activeGenerator = Yii::$app->controller->generator; diff --git a/extensions/gii/views/default/view/files.php b/extensions/gii/views/default/view/files.php index 3da2d97..d8d5f0f 100644 --- a/extensions/gii/views/default/view/files.php +++ b/extensions/gii/views/default/view/files.php @@ -4,8 +4,8 @@ use yii\helpers\Html; use yii\gii\CodeFile; /** - * @var $this \yii\web\View - * @var $generator \yii\gii\Generator + * @var \yii\web\View $this + * @var \yii\gii\Generator $generator * @var CodeFile[] $files * @var array $answers */ diff --git a/extensions/gii/views/layouts/generator.php b/extensions/gii/views/layouts/generator.php index c03f09a..245cd29 100644 --- a/extensions/gii/views/layouts/generator.php +++ b/extensions/gii/views/layouts/generator.php @@ -2,10 +2,10 @@ use yii\helpers\Html; /** - * @var $this \yii\web\View - * @var $content string - * @var yii\gii\Generator[] $generators - * @var yii\gii\Generator $activeGenerator + * @var \yii\web\View $this + * @var \yii\gii\Generator[] $generators + * @var \yii\gii\Generator $activeGenerator + * @var string $content */ $generators = Yii::$app->controller->module->generators; $activeGenerator = Yii::$app->controller->generator; diff --git a/extensions/gii/views/layouts/main.php b/extensions/gii/views/layouts/main.php index 69afeb2..baea45e 100644 --- a/extensions/gii/views/layouts/main.php +++ b/extensions/gii/views/layouts/main.php @@ -4,8 +4,8 @@ use yii\bootstrap\Nav; use yii\helpers\Html; /** - * @var $this \yii\web\View - * @var $content string + * @var \yii\web\View $this + * @var string $content */ $asset = yii\gii\GiiAsset::register($this); ?> diff --git a/extensions/swiftmailer/Message.php b/extensions/swiftmailer/Message.php index bc9c14a..b0ebd63 100644 --- a/extensions/swiftmailer/Message.php +++ b/extensions/swiftmailer/Message.php @@ -192,7 +192,7 @@ class Message extends BaseMessage $partFound = false; foreach ($parts as $key => $part) { if (!($part instanceof \Swift_Mime_Attachment)) { - /* @var $part \Swift_Mime_MimePart */ + /* @var \Swift_Mime_MimePart $part */ if ($part->getContentType() == $contentType) { unset($parts[$key]); $partFound = true; diff --git a/framework/yii/BaseYii.php b/framework/yii/BaseYii.php index 427afff..357a1e7 100644 --- a/framework/yii/BaseYii.php +++ b/framework/yii/BaseYii.php @@ -367,7 +367,7 @@ class BaseYii } if (($n = func_num_args()) > 1) { - /** @var $reflection \ReflectionClass */ + /** @var \ReflectionClass $reflection */ if (isset($reflections[$class])) { $reflection = $reflections[$class]; } else { diff --git a/framework/yii/base/Application.php b/framework/yii/base/Application.php index 70eaca3..497cb2f 100644 --- a/framework/yii/base/Application.php +++ b/framework/yii/base/Application.php @@ -616,10 +616,8 @@ abstract class Application extends Module { $category = get_class($exception); if ($exception instanceof HttpException) { - /** @var $exception HttpException */ $category .= '\\' . $exception->statusCode; } elseif ($exception instanceof \ErrorException) { - /** @var $exception \ErrorException */ $category .= '\\' . $exception->getSeverity(); } Yii::error((string)$exception, $category); diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php index bb98a01..fa05576 100644 --- a/framework/yii/base/Model.php +++ b/framework/yii/base/Model.php @@ -349,7 +349,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess * $model->validators[] = $newValidator; * ~~~ * - * @return ArrayObject all the validators declared in the model. + * @return ArrayObject|\yii\validators\Validator[] all the validators declared in the model. */ public function getValidators() { @@ -369,7 +369,6 @@ class Model extends Component implements IteratorAggregate, ArrayAccess { $validators = []; $scenario = $this->getScenario(); - /** @var $validator Validator */ foreach ($this->getValidators() as $validator) { if ($validator->isActive($scenario) && ($attribute === null || in_array($attribute, $validator->attributes, true))) { $validators[] = $validator; diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index b3e28f6..1e5302c 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -578,7 +578,7 @@ abstract class Module extends Component { $parts = $this->createController($route); if (is_array($parts)) { - /** @var $controller Controller */ + /** @var Controller $controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; diff --git a/framework/yii/base/View.php b/framework/yii/base/View.php index 7b789d1..61d9373 100644 --- a/framework/yii/base/View.php +++ b/framework/yii/base/View.php @@ -410,7 +410,7 @@ class View extends Component { $properties['id'] = $id; $properties['view'] = $this; - /** @var $cache FragmentCache */ + /** @var FragmentCache $cache */ $cache = FragmentCache::begin($properties); if ($cache->getCachedContent() !== false) { $this->endCache(); diff --git a/framework/yii/console/controllers/CacheController.php b/framework/yii/console/controllers/CacheController.php index 1822b73..43932d1 100644 --- a/framework/yii/console/controllers/CacheController.php +++ b/framework/yii/console/controllers/CacheController.php @@ -52,7 +52,7 @@ class CacheController extends Controller */ public function actionFlush($component = 'cache') { - /** @var $cache Cache */ + /** @var Cache $cache */ $cache = Yii::$app->getComponent($component); if (!$cache || !$cache instanceof Cache) { throw new Exception('Application component "'.$component.'" is not defined or not a cache.'); diff --git a/framework/yii/db/ActiveQuery.php b/framework/yii/db/ActiveQuery.php index 015ce93..608ff5c 100644 --- a/framework/yii/db/ActiveQuery.php +++ b/framework/yii/db/ActiveQuery.php @@ -122,7 +122,7 @@ class ActiveQuery extends Query if ($this->asArray) { $model = $row; } else { - /** @var $class ActiveRecord */ + /** @var ActiveRecord $class */ $class = $this->modelClass; $model = $class::create($row); } @@ -145,7 +145,7 @@ class ActiveQuery extends Query */ public function createCommand($db = null) { - /** @var $modelClass ActiveRecord */ + /** @var ActiveRecord $modelClass */ $modelClass = $this->modelClass; if ($db === null) { $db = $modelClass::getDb(); @@ -253,7 +253,7 @@ class ActiveQuery extends Query $models[$key] = $row; } } else { - /** @var $class ActiveRecord */ + /** @var ActiveRecord $class */ $class = $this->modelClass; if ($this->indexBy === null) { foreach ($rows as $row) { diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index 74bc637..00a99c1 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -1321,9 +1321,9 @@ class ActiveRecord extends Model throw new InvalidCallException('Unable to link models: both models must NOT be newly created.'); } if (is_array($relation->via)) { - /** @var $viaRelation ActiveRelation */ + /** @var ActiveRelation $viaRelation */ list($viaName, $viaRelation) = $relation->via; - /** @var $viaClass ActiveRecord */ + /** @var ActiveRecord $viaClass */ $viaClass = $viaRelation->modelClass; $viaTable = $viaClass::tableName(); // unset $viaName so that it can be reloaded to reflect the change @@ -1396,9 +1396,9 @@ class ActiveRecord extends Model if ($relation->via !== null) { if (is_array($relation->via)) { - /** @var $viaRelation ActiveRelation */ + /** @var ActiveRelation $viaRelation */ list($viaName, $viaRelation) = $relation->via; - /** @var $viaClass ActiveRecord */ + /** @var ActiveRecord $viaClass */ $viaClass = $viaRelation->modelClass; $viaTable = $viaClass::tableName(); unset($this->_related[$viaName]); @@ -1444,7 +1444,7 @@ class ActiveRecord extends Model if (!$relation->multiple) { unset($this->_related[$name]); } elseif (isset($this->_related[$name])) { - /** @var $b ActiveRecord */ + /** @var ActiveRecord $b */ foreach ($this->_related[$name] as $a => $b) { if ($model->getPrimaryKey() == $b->getPrimaryKey()) { unset($this->_related[$name][$a]); diff --git a/framework/yii/db/ActiveRelation.php b/framework/yii/db/ActiveRelation.php index 1a7541a..ee4fb96 100644 --- a/framework/yii/db/ActiveRelation.php +++ b/framework/yii/db/ActiveRelation.php @@ -120,7 +120,7 @@ class ActiveRelation extends ActiveQuery $this->filterByModels($viaModels); } elseif (is_array($this->via)) { // via relation - /** @var $viaQuery ActiveRelation */ + /** @var ActiveRelation $viaQuery */ list($viaName, $viaQuery) = $this->via; if ($viaQuery->multiple) { $viaModels = $viaQuery->all(); @@ -154,13 +154,13 @@ class ActiveRelation extends ActiveQuery if ($this->via instanceof self) { // via pivot table - /** @var $viaQuery ActiveRelation */ + /** @var ActiveRelation $viaQuery */ $viaQuery = $this->via; $viaModels = $viaQuery->findPivotRows($primaryModels); $this->filterByModels($viaModels); } elseif (is_array($this->via)) { // via relation - /** @var $viaQuery ActiveRelation */ + /** @var ActiveRelation $viaQuery */ list($viaName, $viaQuery) = $this->via; $viaQuery->primaryModel = null; $viaModels = $viaQuery->findWith($viaName, $primaryModels); @@ -306,7 +306,7 @@ class ActiveRelation extends ActiveQuery return []; } $this->filterByModels($primaryModels); - /** @var $primaryModel ActiveRecord */ + /** @var ActiveRecord $primaryModel */ $primaryModel = reset($primaryModels); $db = $primaryModel->getDb(); list ($sql, $params) = $db->getQueryBuilder()->build($this); diff --git a/framework/yii/db/Command.php b/framework/yii/db/Command.php index 4dffb01..6ed0d9c 100644 --- a/framework/yii/db/Command.php +++ b/framework/yii/db/Command.php @@ -366,7 +366,7 @@ class Command extends \yii\base\Component Yii::info($rawSql, __METHOD__); - /** @var $cache \yii\caching\Cache */ + /** @var \yii\caching\Cache $cache */ if ($db->enableQueryCache && $method !== '') { $cache = is_string($db->queryCache) ? Yii::$app->getComponent($db->queryCache) : $db->queryCache; } diff --git a/framework/yii/db/Schema.php b/framework/yii/db/Schema.php index 41ededa..f2ae94c 100644 --- a/framework/yii/db/Schema.php +++ b/framework/yii/db/Schema.php @@ -92,7 +92,7 @@ abstract class Schema extends Object $realName = $this->getRawTableName($name); if ($db->enableSchemaCache && !in_array($name, $db->schemaCacheExclude, true)) { - /** @var $cache Cache */ + /** @var Cache $cache */ $cache = is_string($db->schemaCache) ? Yii::$app->getComponent($db->schemaCache) : $db->schemaCache; if ($cache instanceof Cache) { $key = $this->getCacheKey($name); @@ -215,7 +215,7 @@ abstract class Schema extends Object */ public function refresh() { - /** @var $cache Cache */ + /** @var Cache $cache */ $cache = is_string($this->db->schemaCache) ? Yii::$app->getComponent($this->db->schemaCache) : $this->db->schemaCache; if ($this->db->enableSchemaCache && $cache instanceof Cache) { GroupDependency::invalidate($cache, $this->getCacheGroup()); diff --git a/framework/yii/log/Target.php b/framework/yii/log/Target.php index cd1256a..c9d5d97 100644 --- a/framework/yii/log/Target.php +++ b/framework/yii/log/Target.php @@ -112,7 +112,7 @@ abstract class Target extends Component { $context = []; if ($this->logUser && ($user = Yii::$app->getComponent('user', false)) !== null) { - /** @var $user \yii\web\User */ + /** @var \yii\web\User $user */ $context[] = 'User: ' . $user->getId(); } diff --git a/framework/yii/rbac/PhpManager.php b/framework/yii/rbac/PhpManager.php index 7332da7..57ede09 100644 --- a/framework/yii/rbac/PhpManager.php +++ b/framework/yii/rbac/PhpManager.php @@ -74,7 +74,7 @@ class PhpManager extends Manager if (!isset($this->_items[$itemName])) { return false; } - /** @var $item Item */ + /** @var Item $item */ $item = $this->_items[$itemName]; Yii::trace('Checking permission: ' . $item->getName(), __METHOD__); if (!isset($params['userId'])) { @@ -85,7 +85,7 @@ class PhpManager extends Manager return true; } if (isset($this->_assignments[$userId][$itemName])) { - /** @var $assignment Assignment */ + /** @var Assignment $assignment */ $assignment = $this->_assignments[$userId][$itemName]; if ($this->executeBizRule($assignment->bizRule, $params, $assignment->data)) { return true; @@ -113,9 +113,9 @@ class PhpManager extends Manager if (!isset($this->_items[$childName], $this->_items[$itemName])) { throw new Exception("Either '$itemName' or '$childName' does not exist."); } - /** @var $child Item */ + /** @var Item $child */ $child = $this->_items[$childName]; - /** @var $item Item */ + /** @var Item $item */ $item = $this->_items[$itemName]; $this->checkItemChildType($item->type, $child->type); if ($this->detectLoop($itemName, $childName)) { @@ -270,14 +270,14 @@ class PhpManager extends Manager $items = []; if ($userId === null) { foreach ($this->_items as $name => $item) { - /** @var $item Item */ + /** @var Item $item */ if ($item->type == $type) { $items[$name] = $item; } } } elseif (isset($this->_assignments[$userId])) { foreach ($this->_assignments[$userId] as $assignment) { - /** @var $assignment Assignment */ + /** @var Assignment $assignment */ $name = $assignment->itemName; if (isset($this->_items[$name]) && ($type === null || $this->_items[$name]->type == $type)) { $items[$name] = $this->_items[$name]; @@ -400,7 +400,7 @@ class PhpManager extends Manager { $items = []; foreach ($this->_items as $name => $item) { - /** @var $item Item */ + /** @var Item $item */ $items[$name] = [ 'type' => $item->type, 'description' => $item->description, @@ -409,7 +409,7 @@ class PhpManager extends Manager ]; if (isset($this->_children[$name])) { foreach ($this->_children[$name] as $child) { - /** @var $child Item */ + /** @var Item $child */ $items[$name]['children'][] = $child->getName(); } } @@ -417,7 +417,7 @@ class PhpManager extends Manager foreach ($this->_assignments as $userId => $assignments) { foreach ($assignments as $name => $assignment) { - /** @var $assignment Assignment */ + /** @var Assignment $assignment */ if (isset($items[$name])) { $items[$name]['assignments'][$userId] = [ 'bizRule' => $assignment->bizRule, @@ -505,7 +505,7 @@ class PhpManager extends Manager return false; } foreach ($this->_children[$childName] as $child) { - /** @var $child Item */ + /** @var Item $child */ if ($this->detectLoop($itemName, $child->getName())) { return true; } diff --git a/framework/yii/requirements/requirements.php b/framework/yii/requirements/requirements.php index f70f414..34b556e 100644 --- a/framework/yii/requirements/requirements.php +++ b/framework/yii/requirements/requirements.php @@ -3,7 +3,7 @@ * These are the Yii core requirements for the [[YiiRequirementChecker]] instance. * These requirements are mandatory for any Yii application. * - * @var $this YiiRequirementChecker + * @var YiiRequirementChecker $this */ return array( array( diff --git a/framework/yii/requirements/views/console/index.php b/framework/yii/requirements/views/console/index.php index 6935107..1d87fe9 100644 --- a/framework/yii/requirements/views/console/index.php +++ b/framework/yii/requirements/views/console/index.php @@ -1,7 +1,7 @@ diff --git a/framework/yii/validators/ExistValidator.php b/framework/yii/validators/ExistValidator.php index 2746b06..ba3f332 100644 --- a/framework/yii/validators/ExistValidator.php +++ b/framework/yii/validators/ExistValidator.php @@ -65,7 +65,7 @@ class ExistValidator extends Validator return; } - /** @var $className \yii\db\ActiveRecord */ + /** @var \yii\db\ActiveRecord $className */ $className = $this->className === null ? get_class($object) : $this->className; $attributeName = $this->attributeName === null ? $attribute : $this->attributeName; $query = $className::find(); @@ -92,7 +92,7 @@ class ExistValidator extends Validator if ($this->attributeName === null) { throw new InvalidConfigException('The "attributeName" property must be set.'); } - /** @var $className \yii\db\ActiveRecord */ + /** @var \yii\db\ActiveRecord $className */ $className = $this->className; $query = $className::find(); $query->where([$this->attributeName => $value]); diff --git a/framework/yii/validators/UniqueValidator.php b/framework/yii/validators/UniqueValidator.php index 334d057..7006cc4 100644 --- a/framework/yii/validators/UniqueValidator.php +++ b/framework/yii/validators/UniqueValidator.php @@ -60,7 +60,7 @@ class UniqueValidator extends Validator return; } - /** @var $className \yii\db\ActiveRecord */ + /** @var \yii\db\ActiveRecord $className */ $className = $this->className === null ? get_class($object) : $this->className; $attributeName = $this->attributeName === null ? $attribute : $this->attributeName; diff --git a/framework/yii/web/AccessControl.php b/framework/yii/web/AccessControl.php index d11f59c..549f087 100644 --- a/framework/yii/web/AccessControl.php +++ b/framework/yii/web/AccessControl.php @@ -102,7 +102,7 @@ class AccessControl extends ActionFilter { $user = Yii::$app->getUser(); $request = Yii::$app->getRequest(); - /** @var $rule AccessRule */ + /** @var AccessRule $rule */ foreach ($this->rules as $rule) { if ($allow = $rule->allows($action, $user, $request)) { return true; diff --git a/framework/yii/web/UrlManager.php b/framework/yii/web/UrlManager.php index 42b12ff..0626fff 100644 --- a/framework/yii/web/UrlManager.php +++ b/framework/yii/web/UrlManager.php @@ -169,7 +169,7 @@ class UrlManager extends Component { if ($this->enablePrettyUrl) { $pathInfo = $request->getPathInfo(); - /** @var $rule UrlRule */ + /** @var UrlRule $rule */ foreach ($this->rules as $rule) { if (($result = $rule->parseRequest($this, $request)) !== false) { Yii::trace("Request parsed with URL rule: {$rule->name}", __METHOD__); @@ -224,7 +224,7 @@ class UrlManager extends Component $baseUrl = $this->getBaseUrl(); if ($this->enablePrettyUrl) { - /** @var $rule UrlRule */ + /** @var UrlRule $rule */ foreach ($this->rules as $rule) { if (($url = $rule->createUrl($this, $route, $params)) !== false) { if ($rule->host !== null) { @@ -282,7 +282,7 @@ class UrlManager extends Component public function getBaseUrl() { if ($this->_baseUrl === null) { - /** @var $request \yii\web\Request */ + /** @var \yii\web\Request $request */ $request = Yii::$app->getRequest(); $this->_baseUrl = $this->showScriptName || !$this->enablePrettyUrl ? $request->getScriptUrl() : $request->getBaseUrl(); } diff --git a/framework/yii/web/User.php b/framework/yii/web/User.php index 0b1cd94..b43d038 100644 --- a/framework/yii/web/User.php +++ b/framework/yii/web/User.php @@ -139,7 +139,7 @@ class User extends Component if ($id === null) { $this->_identity = null; } else { - /** @var $class IdentityInterface */ + /** @var IdentityInterface $class */ $class = $this->identityClass; $this->_identity = $class::findIdentity($id); } @@ -202,7 +202,7 @@ class User extends Component $data = json_decode($value, true); if (count($data) === 3 && isset($data[0], $data[1], $data[2])) { list ($id, $authKey, $duration) = $data; - /** @var $class IdentityInterface */ + /** @var IdentityInterface $class */ $class = $this->identityClass; $identity = $class::findIdentity($id); if ($identity !== null && $identity->validateAuthKey($authKey)) { diff --git a/framework/yii/widgets/ActiveForm.php b/framework/yii/widgets/ActiveForm.php index c018011..b218a2e 100644 --- a/framework/yii/widgets/ActiveForm.php +++ b/framework/yii/widgets/ActiveForm.php @@ -220,7 +220,7 @@ class ActiveForm extends Widget $lines = []; foreach ($models as $model) { - /** @var $model Model */ + /** @var Model $model */ foreach ($model->getFirstErrors() as $error) { $lines[] = Html::encode($error); } diff --git a/tests/unit/data/views/layout.php b/tests/unit/data/views/layout.php index ed7dc27..97a0888 100644 --- a/tests/unit/data/views/layout.php +++ b/tests/unit/data/views/layout.php @@ -1,7 +1,7 @@ beginPage(); ?> @@ -19,4 +19,4 @@ endBody(); ?> -endPage(); ?> \ No newline at end of file +endPage(); ?> diff --git a/tests/unit/data/views/rawlayout.php b/tests/unit/data/views/rawlayout.php index 68cea54..aaa489f 100644 --- a/tests/unit/data/views/rawlayout.php +++ b/tests/unit/data/views/rawlayout.php @@ -1,5 +1,5 @@ beginPage(); ?>1head(); ?>2beginBody(); ?>3endBody(); ?>4endPage(); ?> \ No newline at end of file +?>beginPage(); ?>1head(); ?>2beginBody(); ?>3endBody(); ?>4endPage(); ?> diff --git a/tests/unit/extensions/swiftmailer/MessageTest.php b/tests/unit/extensions/swiftmailer/MessageTest.php index bbdb476..6309f15 100644 --- a/tests/unit/extensions/swiftmailer/MessageTest.php +++ b/tests/unit/extensions/swiftmailer/MessageTest.php @@ -306,7 +306,7 @@ class MessageTest extends VendorTestCase $htmlPresent = false; foreach ($messageParts as $part) { if (!($part instanceof \Swift_Mime_Attachment)) { - /* @var $part \Swift_Mime_MimePart */ + /* @var \Swift_Mime_MimePart $part */ if ($part->getContentType() == 'text/plain') { $textPresent = true; } diff --git a/tests/unit/framework/db/ActiveRecordTest.php b/tests/unit/framework/db/ActiveRecordTest.php index a86c084..d0d2f12 100644 --- a/tests/unit/framework/db/ActiveRecordTest.php +++ b/tests/unit/framework/db/ActiveRecordTest.php @@ -117,7 +117,7 @@ class ActiveRecordTest extends DatabaseTestCase public function testFindLazy() { - /** @var $customer Customer */ + /** @var Customer $customer */ $customer = Customer::find(2); $orders = $customer->orders; $this->assertEquals(2, count($orders)); @@ -137,7 +137,7 @@ class ActiveRecordTest extends DatabaseTestCase public function testFindLazyVia() { - /** @var $order Order */ + /** @var Order $order */ $order = Order::find(1); $this->assertEquals(1, $order->id); $this->assertEquals(2, count($order->items)); @@ -162,7 +162,7 @@ class ActiveRecordTest extends DatabaseTestCase public function testFindLazyViaTable() { - /** @var $order Order */ + /** @var Order $order */ $order = Order::find(1); $this->assertEquals(1, $order->id); $this->assertEquals(2, count($order->books)); diff --git a/tests/unit/framework/validators/ValidatorTest.php b/tests/unit/framework/validators/ValidatorTest.php index fc69c2f..b248a9b 100644 --- a/tests/unit/framework/validators/ValidatorTest.php +++ b/tests/unit/framework/validators/ValidatorTest.php @@ -30,7 +30,7 @@ class ValidatorTest extends TestCase public function testCreateValidator() { $model = FakedValidationModel::createWithAttributes(['attr_test1' => 'abc', 'attr_test2' => '2013']); - /** @var $numberVal NumberValidator */ + /** @var NumberValidator $numberVal */ $numberVal = TestValidator::createValidator('number', $model, ['attr_test1']); $this->assertInstanceOf(NumberValidator::className(), $numberVal); $numberVal = TestValidator::createValidator('integer', $model, ['attr_test2']); @@ -229,4 +229,4 @@ class ValidatorTest extends TestCase $errors = $m->getErrors('attr_msg_val'); $this->assertEquals('attr_msg_val::abc::param_value', $errors[0]); } -} \ No newline at end of file +}