Failed Conditions
Pull Request — master (#6)
by Tibor
01:51
created

Config::shouldSkipFeatures()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Bex\Behat\SkipTestsExtension\ServiceContainer;
4
5
class Config
6
{
7
    const CONFIG_PARAM_SKIP_SCENARIOS = 'skip_scenarios';
8
    const CONFIG_PARAM_SKIP_FEATURES = 'skip_features';
9
    const CONFIG_PARAM_SKIP_TAGS = 'skip_tags';
10
11
    /**
12
     * @var bool
13
     */
14
    private $skipScenarios;
15
16
    /**
17
     * @var string[]
18
     */
19
    private $skipTags = [];
20
21
    /**
22
     * @param array $config
23
     */
24
    public function __construct($config)
25
    {
26
        $this->skipScenarios = $config[self::CONFIG_PARAM_SKIP_SCENARIOS];
27
        $this->skipFeatures = $config[self::CONFIG_PARAM_SKIP_FEATURES];
0 ignored issues
show
Bug introduced by
The property skipFeatures does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
        $this->skipTags = $config[self::CONFIG_PARAM_SKIP_TAGS];
29
    }
30
31
    /**
32
     * @return bool
33
     */
34
    public function shouldSkipScenarios()
35
    {
36
        return $this->skipScenarios;
37
    }
38
39
    /**
40
     * @return bool
41
     */
42
    public function shouldSkipFeatures()
43
    {
44
        return $this->skipFeatures;
45
    }
46
47
    /**
48
     * @return string[]
49
     */
50
    public function getSkipTags()
51
    {
52
        return $this->skipTags;
53
    }
54
}
55