Skip to content

Commit

Permalink
Fix possible bag when using join another table
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jul 12, 2024
1 parent 34f465b commit b6eed37
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ActiveRelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use function array_filter;
use function array_flip;
use function array_intersect_key;
use function array_key_first;
use function array_keys;
use function array_merge;
use function array_unique;
Expand Down Expand Up @@ -551,8 +552,9 @@ protected function filterByModels(array $models): void
$values = [...$scalarValues, ...$nonScalarValues];

$attribute = reset($attributes);
$columnName = array_key_first($this->link);

match ($this->getARInstance()->columnType($attribute)) {
match ($this->getARInstance()->columnType($columnName)) {

Check failure on line 557 in src/ActiveRelationTrait.php

View workflow job for this annotation

GitHub Actions / psalm (8.1, psalm.xml) / PHP 8.1-ubuntu-latest

PossiblyNullArgument

src/ActiveRelationTrait.php:557:55: PossiblyNullArgument: Argument 1 of Yiisoft\ActiveRecord\ActiveRecordInterface::columnType cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 557 in src/ActiveRelationTrait.php

View workflow job for this annotation

GitHub Actions / psalm (8.1, psalm.xml) / PHP 8.1-ubuntu-latest

PossiblyNullArgument

src/ActiveRelationTrait.php:557:55: PossiblyNullArgument: Argument 1 of Yiisoft\ActiveRecord\ActiveRecordInterface::columnType cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 557 in src/ActiveRelationTrait.php

View workflow job for this annotation

GitHub Actions / psalm (8.3, psalm83.xml) / PHP 8.3-ubuntu-latest

PossiblyNullArgument

src/ActiveRelationTrait.php:557:55: PossiblyNullArgument: Argument 1 of Yiisoft\ActiveRecord\ActiveRecordInterface::columnType cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 557 in src/ActiveRelationTrait.php

View workflow job for this annotation

GitHub Actions / psalm (8.2, psalm.xml) / PHP 8.2-ubuntu-latest

PossiblyNullArgument

src/ActiveRelationTrait.php:557:55: PossiblyNullArgument: Argument 1 of Yiisoft\ActiveRecord\ActiveRecordInterface::columnType cannot be null, possibly null value provided (see https://psalm.dev/078)
'array' => $this->andWhere(new ArrayOverlapsCondition($attribute, $values)),
SchemaInterface::TYPE_JSON => $this->andWhere(new JsonOverlapsCondition($attribute, $values)),
default => $this->andWhere(new InCondition($attribute, 'IN', $values)),
Expand Down

0 comments on commit b6eed37

Please sign in to comment.