Scenario::__call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * The Gherkish subpackage contains experimental support classes to implement
5
 * feature testing with a Gherkin inspired syntax.
6
 *
7
 * WARNING Classes in these package are not covered by semver and may change
8
 * without notice.
9
 *
10
 * See features/ for example usage
11
 */
12
13
declare(strict_types=1);
14
15
namespace hanneskod\readmetester\Gherkish;
16
17
final class Scenario
18
{
19
    private FeatureContext $featureContext;
20
21
    public function __construct(FeatureContext $featureContext)
22
    {
23
        $this->featureContext = $featureContext;
24
    }
25
26
    /** @param array<mixed> $arguments */
27
    public function __call(string $name, array $arguments): self
28
    {
29
        $this->featureContext->do(
30
            (string)preg_replace('/^[a-zA-Z]+_/', '', $name),
31
            $arguments
32
        );
33
34
        return $this;
35
    }
36
}
37