Passed
Push — master ( ce7b1b...4d0c94 )
by
unknown
03:04
created

NestedWithCallbackAttribute::validateA()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\TestEnvironments\Support\Data;
6
7
use Yiisoft\Validator\Result;
8
use Yiisoft\Validator\Rule\Callback;
9
use Yiisoft\Validator\Rule\Nested;
10
11
#[Nested([
12
    'a' => new Callback(method: 'validateA'),
13
])]
14
final class NestedWithCallbackAttribute
15
{
16
    private int $a = 7;
0 ignored issues
show
introduced by
The private property $a is not used, and could be removed.
Loading history...
17
18
    #[Nested([
19
        'x' => new Callback(method: 'validateB'),
20
    ])]
21
    private array $b = [
0 ignored issues
show
introduced by
The private property $b is not used, and could be removed.
Loading history...
22
        'x' => 5,
23
    ];
24
25
    private function validateA(): Result
0 ignored issues
show
Unused Code introduced by
The method validateA() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
26
    {
27
        return (new Result())->addError('Invalid A.');
28
    }
29
30
    private function validateB(): Result
0 ignored issues
show
Unused Code introduced by
The method validateB() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
31
    {
32
        return (new Result())->addError('Invalid B.');
33
    }
34
}
35