Passed
Push — master ( 68f9e3...36b0af )
by Andrey
02:57 queued 39s
created

Containable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A container() 0 7 2
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Traits;
4
5
use Illuminate\Container\Container;
6
7
trait Containable
8
{
9
    protected static $containers = [];
10
11 102
    protected function container(string $class, array $parameters = [])
12
    {
13 102
        if (! isset(static::$containers[$class])) {
14 48
            static::$containers[$class] = Container::getInstance()->make($class, $parameters);
15
        }
16
17 102
        return static::$containers[$class];
18
    }
19
}
20