Passed
Pull Request — master (#548)
by Sergei
03:01
created

DataSetWithPostValidationHook   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A processValidationResult() 0 3 1
A getAttributeValue() 0 3 1
A hasAttribute() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Data;
6
7
use Yiisoft\Validator\DataSetInterface;
8
use Yiisoft\Validator\PostValidationHookInterface;
9
use Yiisoft\Validator\Result;
10
11
final class DataSetWithPostValidationHook implements DataSetInterface, PostValidationHookInterface
12
{
13
    public bool $hookCalled = false;
14
15
    public function getAttributeValue(string $attribute): mixed
16
    {
17
        return null;
18
    }
19
20
    public function getData(): ?array
21
    {
22
        return null;
23
    }
24
25
    public function hasAttribute(string $attribute): bool
26
    {
27
        return false;
28
    }
29
30
    public function processValidationResult(Result $result): void
31
    {
32
        $this->hookCalled = true;
33
    }
34
}
35