Passed
Push — test ( 32b011...971610 )
by Tom
03:24
created

RunOpts::setBinaryPackage()   A

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
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\Runner;
6
7
/**
8
 * Runner options parameter object
9
 */
10
class RunOpts
11
{
12
    /**
13
     * @var string
14
     */
15
    private $prefix;
16
17
    /**
18
     * @var string
19
     */
20
    private $binaryPackage;
21
22
    /**
23
     * Static factory method
24
     *
25
     * @param string $prefix
26
     * @param string $binaryPackage package name or path to binary (string)
27
     * @return RunOpts
28
     */
29 1
    public static function create($prefix, $binaryPackage = null)
30
    {
31 1
        return new self($prefix, $binaryPackage);
32
    }
33
34
    /**
35
     * RunOpts constructor.
36
     *
37
     * NOTE: All run options are optional by design (pass NULL).
38
     *
39
     * @param string $prefix
40
     * @param string $binaryPackage package name or path to binary (string)
41
     */
42 1
    public function __construct($prefix = null, $binaryPackage = null)
43
    {
44 1
        $this->prefix = $prefix;
45 1
        $this->binaryPackage = $binaryPackage;
46 1
    }
47
48
    /**
49
     * @param string $prefix
50
     */
51 1
    public function setPrefix($prefix)
52
    {
53 1
        $this->prefix = $prefix;
54 1
    }
55
56
    /**
57
     * The prefix is used when creating containers for the container name.
58
     *
59
     * See --prefix option.
60
     *
61
     * @return string
62
     */
63 1
    public function getPrefix()
64
    {
65 1
        return $this->prefix;
66
    }
67
68
    /**
69
     * @param string $binaryPackage
70
     */
71 1
    public function setBinaryPackage($binaryPackage)
72
    {
73 1
        $this->binaryPackage = $binaryPackage;
74 1
    }
75
76
    /**
77
     * @return string
78
     */
79 1
    public function getBinaryPackage()
80
    {
81 1
        return $this->binaryPackage;
82
    }
83
}
84