Skip to content

Commit 56d22ca

Browse files
authored
Merge pull request #42 from utopia-php/update-example
2 parents b061f52 + d8aa999 commit 56d22ca

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

pint.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"preset": "psr12",
3+
"exclude": [],
4+
"rules": {
5+
"array_indentation": true,
6+
"single_import_per_statement": true,
7+
"simplified_null_return": true,
8+
"ordered_imports": {
9+
"sort_algorithm": "alpha",
10+
"imports_order": [
11+
"const",
12+
"class",
13+
"function"
14+
]
15+
}
16+
}
17+
}

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)