Condition::getArgs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Config;
13
14
/**
15
 * Class Action
16
 *
17
 * @package CaptainHook
18
 * @author  Sebastian Feldmann <[email protected]>
19
 * @link    https://github.com/captainhook-git/captainhook
20
 * @since   Class available since Release 4.2.0
21
 * @internal
22
 */
23
class Condition
24
{
25
    /**
26
     * Condition executable
27
     *
28
     * @var string
29
     */
30
    private $exec;
31
32
    /**
33
     * Condition arguments
34
     *
35
     * @var array<mixed>
36
     */
37
    private $args;
38
39
    /**
40
     * Condition constructor
41
     *
42
     * @param string       $exec
43
     * @param array<mixed> $args
44
     */
45 19
    public function __construct(string $exec, array $args = [])
46
    {
47 19
        $this->exec = $exec;
48 19
        $this->args = $args;
49
    }
50
51
    /**
52
     * Exec getter
53
     *
54
     * @return string
55
     */
56 12
    public function getExec(): string
57
    {
58 12
        return $this->exec;
59
    }
60
61
    /**
62
     * Args getter
63
     *
64
     * @return array<mixed>
65
     */
66 7
    public function getArgs(): array
67
    {
68 7
        return $this->args;
69
    }
70
71
    /**
72
     * Return config data
73
     *
74
     * @return array<string, mixed>
75
     */
76 1
    public function getJsonData(): array
77
    {
78 1
        return [
79 1
            'exec' => $this->exec,
80 1
            'args' => $this->args,
81 1
        ];
82
    }
83
}
84