Passed
Pull Request — development (#682)
by Nick
07:18
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
/**
6
 * Class HandleFormContext
7
 *
8
 * @package Oc\FieldNotes\Context
0 ignored issues
show
introduced by
Unexpected tag type @package in doc block
Loading history...
9
 */
10
class HandleFormContext
11
{
12
    /**
13
     * @var bool
14
     */
15
    private $success;
16
17
    /**
18
     * @var string[]
19
     */
20
    private $errors;
21
22
    /**
23
     * HandleFormContext constructor.
24
     *
25
     * @param bool $success
26
     * @param array $errors
27
     */
28
    public function __construct($success, array $errors)
29
    {
30
        $this->success = $success;
31
        $this->errors = $errors;
32
    }
33
34
    /**
35
     * Was the handling of the form successful?
36
     *
37
     * @return bool
38
     */
39
    public function isSuccess()
40
    {
41
        return $this->success;
42
    }
43
44
    /**
45
     * List of translated error message to display in the frontend.
46
     *
47
     * @return string[]
48
     */
49
    public function getErrors()
50
    {
51
        return $this->errors;
52
    }
53
}
54