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

HandleFormContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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