Passed
Push — master ( 687096...46e968 )
by Kevin
05:04 queued 02:05
created

ContainerBC   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 6
c 1
b 0
f 1
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A container() 0 11 3
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Functional;
4
5
use Psr\Container\ContainerInterface;
6
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10
trait ContainerBC
11
{
12
    private static function container(): ContainerInterface
13
    {
14
        if (!\method_exists(static::class, 'getContainer')) {
15
            if (!static::$booted) {
16
                static::bootKernel();
17
            }
18
19
            return self::$container;
20
        }
21
22
        return self::getContainer();
23
    }
24
}
25