Passed
Pull Request — master (#446)
by Sergei
03:27
created

CallbackDto   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 7
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Data;
6
7
use Yiisoft\Validator\Result;
8
use Yiisoft\Validator\Rule\Callback;
9
10
#[Callback('\Yiisoft\Validator\Tests\Support\Data\validate')]
11
final class CallbackDto
12
{
13
    public function __construct(
14
        public int $a,
15
        public int $b,
16
    ) {
17
    }
18
}
19
20
function validate(CallbackDto $dto): Result
21
{
22
    return (new Result())->addError($dto->a . ' / ' . $dto->b);
23
}
24