Skip to content

Commit 6a8c2d0

Browse files
authored
Add yiisoft/validator of version ^2.0 support (#47)
1 parent 3125fcd commit 6a8c2d0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## 1.0.1 under development
44

5-
- no changes in this release.
5+
- Enh #47: Add `yiisoft/validator` of version `^2.0` support (@vjik)
66

77
## 1.0.0 March 07, 2024
88

9-
- Initial release.
9+
- Initial release.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"yiisoft/hydrator": "^1.0",
4242
"yiisoft/hydrator-validator": "^2.0",
4343
"yiisoft/middleware-dispatcher": "^5.1",
44-
"yiisoft/validator": "^1.1",
44+
"yiisoft/validator": "^1.1|^2.0",
4545
"yiisoft/request-provider": "^1.0"
4646
},
4747
"require-dev": {

tests/RequestInputParametersResolverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testBase(): void
3838
$this->assertInstanceOf(PersonInput::class, $person);
3939
$this->assertFalse($person->getValidationResult()->isValid());
4040
$this->assertSame(
41-
['name' => ['Value cannot be blank.']],
41+
['name' => ['Name is required.']],
4242
$person->getValidationResult()->getErrorMessagesIndexedByPath()
4343
);
4444

tests/Support/Input/PersonInput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
final class PersonInput extends AbstractInput
1313
{
1414
public function __construct(
15-
#[Required]
15+
#[Required(message: 'Name is required.')]
1616
public string $name = '',
1717
) {
1818
}

0 commit comments

Comments
 (0)