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

CompositeExemplifyRunner::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 1
1
<?php
2
3
namespace RMiller\BehatSpec\Extension\PhpSpecExtension\Process\ExemplifyRunner;
4
5
use RMiller\BehatSpec\Extension\PhpSpecExtension\Process\ExemplifyRunner;
6
7
class CompositeExemplifyRunner implements ExemplifyRunner
8
{
9
    /**
10
     * @var ExemplifyRunner
11
     */
12
    private $exemplifyRunner;
13
14
    /**
15
     * @param PlatformSpecificExemplifyRunner[] $exemplifyRunners
16
     */
17
    public function __construct(array $exemplifyRunners)
18
    {
19
        foreach ($exemplifyRunners as $exemplifyRunner) {
20
            if ($exemplifyRunner->isSupported()) {
21
                $this->exemplifyRunner = $exemplifyRunner;
22
                break;
23
            }
24
        }
25
    }
26
27
    public function runExemplifyCommand($className, $methodName)
28
    {
29
        $this->exemplifyRunner->runExemplifyCommand($className, $methodName);
30
    }
31
}
32