Skip to content

Commit

Permalink
Use PluginManager::build() instead of get in order to support constru…
Browse files Browse the repository at this point in the history
…ctor options via `InvokableFactory`

Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Jun 28, 2024
1 parent 57f1fe7 commit cd906d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/StaticValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function execute(mixed $value, $classBaseName, array $options = []
}

$plugins = static::getPluginManager();
$validator = $plugins->get($classBaseName, $options);
$validator = $plugins->build($classBaseName, $options);

return $validator->isValid($value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ValidatorChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function setPluginManager(ValidatorPluginManager $plugins)
public function plugin($name, ?array $options = null)
{
$plugins = $this->getPluginManager();
return $plugins->get($name, $options);
return $plugins->build($name, $options);
}

/**
Expand Down

0 comments on commit cd906d5

Please sign in to comment.