Scenario   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 10
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A pipeline() 0 3 1
A getCallback() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WSW\BrowserAutomation\Scenario;
6
7
use WSW\BrowserAutomation\Pipeline\Pipeline;
8
use WSW\BrowserAutomation\Pipeline\PipelineInterface;
9
10
/**
11
 * Class Scenario
12
 *
13
 * @package WSW\BrowserAutomation\Scenario
14
 */
15
class Scenario implements ScenarioInterface
16
{
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var callable
24
     */
25
    private $callback;
26
27
    /**
28
     * @var PipelineInterface
29
     */
30
    private $pipeline;
31
32
    /**
33
     * Scenario constructor.
34
     *
35
     * @param string $name
36
     * @param callable $callback
37
     * @param PipelineInterface $pipeline
38
     */
39 39
    public function __construct(string $name, callable $callback, PipelineInterface $pipeline = null)
40
    {
41 39
        $this->name = $name;
42 39
        $this->callback = $callback;
43 39
        $this->pipeline = $pipeline ?? new Pipeline();
44 39
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 21
    public function getName(): string
50
    {
51 21
        return $this->name;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57 12
    public function getCallback(): callable
58
    {
59 12
        return $this->callback;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65 15
    public function pipeline(): PipelineInterface
66
    {
67 15
        return $this->pipeline;
68
    }
69
}
70