Completed
Push — development ( daed94...13a157 )
by Thomas
18s
created

HandleFormContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSuccess() 0 4 1
A getErrors() 0 4 1
1
<?php
2
3
namespace Oc\FieldNotes\Context;
4
5
class HandleFormContext
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $success;
11
12
    /**
13
     * @var string[]
14
     */
15
    private $errors;
16
17
    /**
18
     * @param bool $success
19
     * @param array $errors
20
     */
21
    public function __construct($success, array $errors)
22
    {
23
        $this->success = $success;
24
        $this->errors = $errors;
25
    }
26
27
    /**
28
     * @return bool
29
     */
30
    public function isSuccess()
31
    {
32
        return $this->success;
33
    }
34
35
    /**
36
     * List of translated error message to display in the frontend.
37
     *
38
     * @return string[]
39
     */
40
    public function getErrors()
41
    {
42
        return $this->errors;
43
    }
44
}
45