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

RunOpts   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
c 1
b 0
f 1
dl 0
loc 72
ccs 16
cts 16
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 3 1
A getPrefix() 0 3 1
A setPrefix() 0 3 1
A setBinaryPackage() 0 3 1
A getBinaryPackage() 0 3 1
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