Skip to content

Commit d5c8535

Browse files
authored
Merge pull request #41 from utopia-php/add-example
feat: add example parameter to Action::param method
2 parents 1e33b7c + 1490b60 commit d5c8535

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Platform/Action.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ public function getParams(): array
168168
* @param array $injections
169169
* @param bool $skipValidation
170170
* @param bool $deprecated
171+
* @param string $example
171172
* @return self
172173
*/
173-
public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = [], bool $skipValidation = false, bool $deprecated = false): self
174+
public function param(string $key, mixed $default, Validator|callable $validator, string $description = '', bool $optional = false, array $injections = [], bool $skipValidation = false, bool $deprecated = false, string $example = ''): self
174175
{
175176
$param = [
176177
'default' => $default,
@@ -180,6 +181,7 @@ public function param(string $key, mixed $default, Validator|callable $validator
180181
'injections' => $injections,
181182
'skipValidation' => $skipValidation,
182183
'deprecated' => $deprecated, // TODO: @Meldiron implement tests
184+
'example' => $example,
183185
];
184186
$this->options['param:'.$key] = array_merge($param, ['type' => 'param']);
185187
$this->params[$key] = $param;

0 commit comments

Comments
 (0)