BaseTestCase::getContainer()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
namespace Psi\Bundle\Grid\Tests\Functional;
4
5
use Psi\Bundle\Grid\Example\app\AppKernel;
6
7
class BaseTestCase extends \PHPUnit_Framework_TestCase
8
{
9
    private $container;
10
11
    protected function getContainer()
12
    {
13
        if ($this->container) {
14
            return $this->conatiner;
0 ignored issues
show
Bug introduced by
The property conatiner 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...
15
        }
16
17
        $kernel = new AppKernel('dev', true);
18
        $kernel->boot();
19
        $container = $kernel->getContainer();
20
21
        return $container;
22
    }
23
}
24