CompositeRunRunner   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
A runRunCommand() 0 4 1
1
<?php
2
3
namespace RMiller\BehatSpec\Extension\PhpSpecRunExtension\Process\RunRunner;
4
5
use RMiller\BehatSpec\Extension\PhpSpecRunExtension\Process\RunRunner;
6
7
class CompositeRunRunner implements RunRunner
8
{
9
    /**
10
     * @var RunRunner
11
     */
12
    private $runRunner;
13
14
    /**
15
     * @param PlatformSpecificRunRunner[] $runRunners
16
     */
17
    public function __construct(array $runRunners)
18
    {
19
        foreach ($runRunners as $runRunner) {
20
            if ($runRunner->isSupported()) {
21
                $this->runRunner = $runRunner;
22
                break;
23
            }
24
        }
25
    }
26
27
    public function runRunCommand()
28
    {
29
        $this->runRunner->runRunCommand();
30
    }
31
}
32