SuiteInfo::getActor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace SmartWeb\ModuleTesting\Codeception\SmartWeb;
5
6
use SmartWeb\ModuleTesting\Codeception\StringCollection;
7
use SmartWeb\ModuleTesting\Codeception\SuiteInfoInterface;
8
9
10
/**
11
 * Class SuiteInfo
12
 *
13
 * @package SmartWeb\ModuleTesting\Codeception
14
 */
15
class SuiteInfo implements SuiteInfoInterface
16
{
17
    
18
    /**
19
     * @var string
20
     */
21
    protected $name;
22
    
23
    /**
24
     * @var string
25
     */
26
    protected $actor;
27
    
28
    /**
29
     * @var StringCollection
30
     */
31
    protected $modules;
32
    
33
    /**
34
     * SuiteInfo constructor.
35
     *
36
     * @param string                    $name
37
     * @param string                    $actor
38
     * @param string[]|StringCollection $modules
39
     */
40
    public function __construct(string $name, string $actor = self::ACTOR_SUFFIX, $modules = [])
41
    {
42
        $this->name = $name;
43
        $this->actor = ($actor == self::ACTOR_SUFFIX)
44
            ? $name . self::ACTOR_SUFFIX
45
            : $actor;
46
        $this->modules = new StringCollection($modules);
47
    }
48
    
49
    /**
50
     * @return string
51
     */
52
    public function getName() : string
53
    {
54
        return $this->name;
55
    }
56
    
57
    /**
58
     * @return string
59
     */
60
    public function getActor() : string
61
    {
62
        return $this->actor;
63
    }
64
    
65
    /**
66
     * @return StringCollection
67
     */
68
    public function getModules() : StringCollection
69
    {
70
        return clone $this->modules;
71
    }
72
    
73
}
74