Completed
Push — development ( e80362...5ad269 )
by Claudio
02:41
created

NuxValidation::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 4
nop 3
1
<?php
2
3
namespace App\Models;
4
5
/**
6
 * Class NuxValidation
7
 * @package App\Models
8
 */
9
class NuxValidation
10
{
11
    /**
12
     * Result Code
13
     *
14
     * @var string
15
     */
16
    public $code;
17
18
    /**
19
     * Specification of what Happened
20
     *
21
     * @var array|null
22
     */
23
    public $validationResult = null;
24
25
    /**
26
     * Username Suggestions
27
     *
28
     * @TODO: Code Suggestions
29
     *
30
     * @var array|null
31
     */
32
    public $suggestions = array();
33
34
    /**
35
     * Create a NUX Validation
36
     *
37
     * @param string $code
38
     * @param array $validationResult
39
     * @param array $suggestions
40
     */
41
    public function __construct(string $code = 'OK', array $validationResult = array(), array $suggestions = array())
42
    {
43
        $this->code = $code;
44
45
        if (!empty($validationResult)) {
46
            $this->validationResult = $validationResult;
47
        }
48
49
        if (!empty($suggestions)) {
50
            $this->suggestions = $suggestions;
51
        }
52
    }
53
}
54