Passed
Pull Request — master (#464)
by Sergei
11:05
created

processValidationResult()   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 1
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\Support\Data;
6
7
use Yiisoft\Validator\PostValidationHookInterface;
8
use Yiisoft\Validator\Result;
9
10
final class ObjectWithPostValidationHook implements PostValidationHookInterface
11
{
12
    public static $hookCalled = false;
13
14
    public function getAttributeValue(string $attribute): mixed
15
    {
16
        return null;
17
    }
18
19
    public function getData(): ?array
20
    {
21
        return null;
22
    }
23
24
    public function getSource(): array
25
    {
26
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Yiisoft\Validator\Tests\...tWithPostValidationHook which is incompatible with the type-hinted return array.
Loading history...
27
    }
28
29
    public function hasAttribute(string $attribute): bool
30
    {
31
        return false;
32
    }
33
34
    public function processValidationResult(Result $result): void
35
    {
36
        self::$hookCalled = true;
37
    }
38
}
39