Passed
Push — master ( 71d777...1cedb5 )
by Tom
04:21
created

RunOpts   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setPrefix() 0 3 1
A create() 0 3 1
A getPrefix() 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
     * Static factory method
19
     *
20
     * @param string $prefix
21
     * @return RunOpts
22
     */
23 1
    public static function create($prefix)
24
    {
25 1
        return new self($prefix);
26
    }
27
28
    /**
29
     * RunOpts constructor.
30
     *
31
     * NOTE: All run options are optional by design (pass NULL).
32
     *
33
     * @param string $prefix
34
     * @param string $binaryPackage package name or path to binary (string)
35
     */
36 1
    public function __construct($prefix = null)
37
    {
38 1
        $this->prefix = $prefix;
39 1
    }
40
41
    /**
42
     * @param string $prefix
43
     */
44 1
    public function setPrefix($prefix)
45
    {
46 1
        $this->prefix = $prefix;
47 1
    }
48
49
    /**
50
     * The prefix is used when creating containers for the container name.
51
     *
52
     * See --prefix option.
53
     *
54
     * @return string
55
     */
56 1
    public function getPrefix()
57
    {
58 1
        return $this->prefix;
59
    }
60
}
61