data-transfer-object/tests/Casters/SimpleValueCaster.php
2026-02-23 21:09:02 -03:00

20 lines
333 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Casters;
class SimpleValueCaster
{
public function cast(mixed $data): SimpleValue
{
return new SimpleValue($data['value'] * 2);
}
public static function rules(): array
{
return [
'value' => ['required', 'numeric'],
];
}
}