TestKernelTrait::getContainerBaseClass()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace RDV\SymfonyContainerMocks\DependencyInjection;
4
5
trait TestKernelTrait
6
{
7
    /**
8
     * @return string
9
     */
10
    protected function getContainerBaseClass()
11
    {
12
        if ('test' === $this->environment) {
0 ignored issues
show
Bug introduced by
The property environment 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...
13
            return TestContainer::class;
14
        }
15
16
        return parent::getContainerBaseClass();
17
    }
18
}
19
20