Passed
Pull Request — master (#464)
by Sergei
02:35
created

ObjectWithPostValidationHook   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A hasAttribute() 0 3 1
A getAttributeValue() 0 3 1
A getData() 0 3 1
A processValidationResult() 0 3 1
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 hasAttribute(string $attribute): bool
25
    {
26
        return false;
27
    }
28
29
    public function processValidationResult(Result $result): void
30
    {
31
        self::$hookCalled = true;
32
    }
33
}
34