Scenario   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __call() 0 8 1
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