Skip to content

Commit

Permalink
feat: add missing skipValidation param option
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Oct 22, 2024
1 parent 95d57f3 commit 5259da0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Platform/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,15 @@ public function getParams(): array
* @param array $injections
* @return self
*/
public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = []): self
public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = [], bool $skipValidation = false): self
{
$param = [
'default' => $default,
'validator' => $validator,
'description' => $description,
'optional' => $optional,
'injections' => $injections,
'skipValidation' => $skipValidation,
];
$this->options['param:'.$key] = array_merge($param, ['type' => 'param']);
$this->params[$key] = $param;
Expand Down
6 changes: 3 additions & 3 deletions src/Platform/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function initHttp(array $services): void
switch ($option['type']) {
case 'param':
$key = substr($key, stripos($key, ':') + 1);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections']);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections'], $option['skipValidation']);
break;
case 'injection':
$hook->inject($option['name']);
Expand Down Expand Up @@ -165,7 +165,7 @@ protected function initTasks(array $services): void
switch ($option['type']) {
case 'param':
$key = substr($key, stripos($key, ':') + 1);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections']);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections'], $option['skipValidation']);
break;
case 'injection':
$hook->inject($option['name']);
Expand Down Expand Up @@ -222,7 +222,7 @@ protected function initWorker(array $services, string $workerName): void
switch ($option['type']) {
case 'param':
$key = substr($key, stripos($key, ':') + 1);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections']);
$hook->param($key, $option['default'], $option['validator'], $option['description'], $option['optional'], $option['injections'], $option['skipValidation']);
break;
case 'injection':
$hook->inject($option['name']);
Expand Down

0 comments on commit 5259da0

Please sign in to comment.