Completed
Push — master ( 5f4179...916f6e )
by Richard
11s
created

CompositeDescRunner   A

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 runDescCommand() 0 4 1
1
<?php
2
3
namespace RMiller\BehatSpec\Extension\PhpSpecExtension\Process\DescRunner;
4
5
use RMiller\BehatSpec\Extension\PhpSpecExtension\Process\DescRunner;
6
7
class CompositeDescRunner implements DescRunner
8
{
9
    /**
10
     * @var DescRunner
11
     */
12
    private $descRunner;
13
14
    /**
15
     * @param PlatformSpecificDescRunner[] $descRunners
16
     */
17
    public function __construct(array $descRunners)
18
    {
19
        foreach ($descRunners as $descRunner) {
20
            if ($descRunner->isSupported()) {
21
                $this->descRunner = $descRunner;
22
                break;
23
            }
24
        }
25
    }
26
27
    public function runDescCommand($className)
28
    {
29
        $this->descRunner->runDescCommand($className);
30
    }
31
}
32