Skip to content

Commit 70a5216

Browse files
added example value parameter
1 parent 6f3cf06 commit 70a5216

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Pecee/Http/Input/Attributes/ValidatorAttribute.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ class ValidatorAttribute
2020
* @param string|null $name
2121
* @param string|null $type
2222
* @param string|array $validator
23+
* @param mixed|null $example
2324
*/
2425
public function __construct(
2526
private ?string $name = null,
2627
?string $type = null,
27-
string|array $validator = array()
28+
string|array $validator = array(),
29+
private mixed $example = null
2830
){
2931
if(is_string($validator))
3032
$validator = explode('|', $validator);
@@ -115,4 +117,12 @@ public function getFullValidator(): array
115117
return $validator;
116118
}
117119

120+
/**
121+
* @return mixed
122+
*/
123+
public function getExample(): mixed
124+
{
125+
return $this->example;
126+
}
127+
118128
}

0 commit comments

Comments
 (0)