GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( d36980...ed81f3 )
by Gabriel
04:24
created

ContainerAliasBindingsTrait   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 71
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0
wmc 9
lcom 2
cbo 3

8 Methods

Rating   Name   Duplication   Size   Complexity  
A initContainer() 0 8 2
A initContainerBindings() 0 3 1
A generateContainer() 0 4 1
A get() 0 4 1
A has() 0 4 1
A set() 0 4 1
A share() 0 4 1
A addServiceProvider() 0 4 1
1
<?php
2
3
namespace Nip\Container;
4
5
use League\Container\ServiceProvider\ServiceProviderInterface;
6
7
/**
8
 * Class ContainerAliasBindingsTrait
9
 * @package Nip\Container
10
 */
11
trait ContainerAliasBindingsTrait
12
{
13
    use ContainerAwareTrait;
14
15
    public function initContainer()
16
    {
17
        if ($this->hasContainer()) {
18
            return;
19
        }
20
        $this->setContainer($this->generateContainer());
21
        $this->initContainerBindings();
22
    }
23
24
    protected function initContainerBindings()
25
    {
26
    }
27
28
    /**
29
     * @return ContainerInterface
30
     */
31
    public function generateContainer()
32
    {
33
        return Container::getInstance();
34
    }
35
36
    /**
37
     * @param $alias
38
     * @return mixed
39
     */
40
    public function get($alias)
41
    {
42
        return $this->getContainer()->get($alias);
43
    }
44
45
    /**
46
     * @param $alias
47
     * @return mixed
48
     */
49
    public function has($alias)
50
    {
51
        return $this->getContainer()->has($alias);
52
    }
53
54
    /**
55
     * @param $alias
56
     * @param null $concrete
57
     * @param bool $share
58
     */
59
    public function set($alias, $concrete = null, $share = false)
60
    {
61
        $this->getContainer()->set($alias, $concrete, $share);
62
    }
63
64
    /**
65
     * @param $alias
66
     * @param null $concrete
67
     */
68
    public function share($alias, $concrete = null)
69
    {
70
        $this->getContainer()->share($alias, $concrete);
71
    }
72
73
    /**
74
     * @param string|ServiceProviderInterface $provider
75
     * @return void
76
     */
77
    public function addServiceProvider($provider)
78
    {
79
        $this->getContainer()->addServiceProvider($provider);
80
    }
81
}