OverwriteRules
This commit is contained in:
parent
3a26a2e0c2
commit
709201547c
8 changed files with 252 additions and 19 deletions
25
tests/Rules/WithOverwriteRules.php
Normal file
25
tests/Rules/WithOverwriteRules.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Rules;
|
||||
|
||||
use Icefox\DTO\Attributes\OverwriteRules;
|
||||
use Icefox\DTO\DataObject;
|
||||
|
||||
readonly class WithOverwriteRules
|
||||
{
|
||||
use DataObject;
|
||||
|
||||
public function __construct(
|
||||
public int $value,
|
||||
) {}
|
||||
|
||||
#[OverwriteRules]
|
||||
public static function rules(): array
|
||||
{
|
||||
return [
|
||||
'value' => ['numeric', 'max:20'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue