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

CompositeDescRunner::runDescCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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