mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-12 17:30:57 +08:00
Add missing generics in yii\validators and yii\log namespaces (#20644)
This commit is contained in:
@@ -116,13 +116,17 @@ class ExistValidator extends Validator
|
||||
|
||||
/**
|
||||
* Validates existence of the current attribute based on relation name
|
||||
* @param \yii\db\ActiveRecord $model the data model to be validated
|
||||
* @param ActiveRecord $model the data model to be validated
|
||||
* @param string $attribute the name of the attribute to be validated.
|
||||
*/
|
||||
private function checkTargetRelationExistence($model, $attribute)
|
||||
{
|
||||
$exists = false;
|
||||
/** @var ActiveQuery $relationQuery */
|
||||
|
||||
/**
|
||||
* @var ActiveQuery $relationQuery
|
||||
* @phpstan-var ActiveQuery<ActiveRecord>
|
||||
*/
|
||||
$relationQuery = $model->{'get' . ucfirst($this->targetRelation)}();
|
||||
|
||||
if ($this->filter instanceof \Closure) {
|
||||
@@ -316,6 +320,8 @@ class ExistValidator extends Validator
|
||||
* @param array $conditions array of condition, keys to be modified
|
||||
* @param string|null $alias set empty string for no apply alias. Set null for apply primary table alias
|
||||
* @return array
|
||||
*
|
||||
* @phpstan-param ActiveQuery<ActiveRecord> $query
|
||||
*/
|
||||
private function applyTableAlias($query, $conditions, $alias = null)
|
||||
{
|
||||
|
||||
@@ -241,6 +241,8 @@ class UniqueValidator extends Validator
|
||||
* @param array $conditions conditions, compatible with [[\yii\db\Query::where()|Query::where()]] key-value format
|
||||
*
|
||||
* @return ActiveQueryInterface|ActiveQuery
|
||||
*
|
||||
* @phpstan-return ActiveQueryInterface|ActiveQuery<ActiveRecord>
|
||||
*/
|
||||
private function prepareQuery($targetClass, $conditions)
|
||||
{
|
||||
@@ -319,6 +321,8 @@ class UniqueValidator extends Validator
|
||||
* @param array $conditions array of condition, keys to be modified
|
||||
* @param string|null $alias set empty string for no apply alias. Set null for apply primary table alias
|
||||
* @return array
|
||||
*
|
||||
* @phpstan-param ActiveQuery<ActiveRecord> $query
|
||||
*/
|
||||
private function applyTableAlias($query, $conditions, $alias = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user