Skip to content

Commit

Permalink
added RuleHelperTest
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Oct 12, 2024
1 parent 8a0768a commit d542feb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ public function __construct(private readonly array|Rule $data, ?string $paramPre
if(!is_null($paramPrefix)){
$this->paramPrefix = $paramPrefix;
}
$rules = $this->data;

if(is_array($this->data)) {
/** @var Rule $rules */
$rules = \Yii::createObject(array_merge([
'class' => Rule::class,
],$this->data));
} else {
$rules = $this->data;
}

$this->_where = $this->buildWhere($rules);
Expand Down

0 comments on commit d542feb

Please sign in to comment.