Completed
Push — master ( d27e1e...d6d70b )
by Hannes
01:43
created

Valid   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 30
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isValid() 0 4 1
A getValidData() 0 4 1
A getErrors() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace hanneskod\clean;
6
7
final class Valid implements ResultInterface
8
{
9
    /**
10
     * @var mixed
11
     */
12
    private $data;
13
14
    /**
15
     * @param mixed $data
16
     */
17
    public function __construct($data)
18
    {
19
        $this->data = $data;
20
    }
21
22
    public function isValid(): bool
23
    {
24
        return true;
25
    }
26
27
    public function getValidData()
28
    {
29
        return $this->data;
30
    }
31
32
    public function getErrors(): array
33
    {
34
        return [];
35
    }
36
}
37