Result   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
A addError() 0 3 1
A getErrors() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Response\Validation;
6
7
/**
8
 * Simple Result object
9
 */
10
class Result
11
{
12
    /** @var array */
13
    private array $errors = [];
14
15
16
    /**
17
     */
18
    public function addError(string $message): void
19
    {
20
        $this->errors[] = $message;
21
    }
22
23
24
    /**
25
     */
26
    public function isValid(): bool
27
    {
28
        return empty($this->errors);
29
    }
30
31
32
    /**
33
     * @return array
34
     */
35
    public function getErrors(): array
36
    {
37
        return $this->errors;
38
    }
39
}
40