GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ByScenarioNameFileNamingStrategy::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace BVCR\Behat\Cassette;
4
5
use Behat\Gherkin\Node\FeatureNode;
6
use Behat\Gherkin\Node\OutlineNode;
7
use Behat\Gherkin\Node\ScenarioInterface;
8
use Behat\Transliterator\Transliterator;
9
10
class ByScenarioNameFileNamingStrategy implements FileNamingStrategy
11
{
12
    const DEFAULT_SEPARATOR = '_';
13
    private $separator;
14
15 3
    public function __construct($separator = self::DEFAULT_SEPARATOR)
16
    {
17 3
        $this->separator = $separator;
18 3
    }
19
20 2
    public function createFilename(FeatureNode $feature, ScenarioInterface $scenario, OutlineNode $outline = null)
21
    {
22 2
        $filename = Transliterator::transliterate($feature->getTitle(), $this->separator) . DIRECTORY_SEPARATOR;
23
24 2
        if ($outline) {
25 1
            $filename .= Transliterator::transliterate($outline->getTitle(), $this->separator)
26 1
                . DIRECTORY_SEPARATOR . $this->separator;
27 1
        }
28
29 2
        $filename .= Transliterator::transliterate($scenario->getTitle(), $this->separator);
30
31 2
        if ($outline) {
32 1
            $filename .= $this->separator;
33 1
        }
34
35 2
        return $filename;
36
    }
37
}
38