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

CompositeWithCallbackAttribute   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validateA() 0 3 1
A validateB() 0 3 1
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\Composite;
10
11
#[Composite([
12
    new Callback(method: 'validateA'),
13
])]
14
final class CompositeWithCallbackAttribute
15
{
16
    #[Composite([
17
        new Callback(method: 'validateB'),
18
    ])]
19
    private int $b = 7;
0 ignored issues
show
introduced by
The private property $b is not used, and could be removed.
Loading history...
20
21
    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...
22
    {
23
        return (new Result())->addError('Invalid A.');
24
    }
25
26
    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...
27
    {
28
        return (new Result())->addError('Invalid B.');
29
    }
30
}
31