Completed
Push — master ( 401342...5694de )
by Ramūnas
01:31
created

TestKernelTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContainerBaseClass() 0 8 2
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