Passed
Pull Request — master (#60)
by Andrey
11:17
created

Containable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 11
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
    protected function container(string $class)
12
    {
13
        if (! isset(static::$containers[$class])) {
14
            static::$containers[$class] = Container::getInstance()->make($class);
15
        }
16
17
        return static::$containers[$class];
18
    }
19
}
20