Completed
Push — master ( 6634cb...f6cba5 )
by Kacper
06:10
created

ServiceManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
getContainer() 0 1 ?
A has() 0 4 1
1
<?php
2
/**
3
 * Nucleus - XMPP Library for PHP
4
 *
5
 * Copyright (C) 2016, Some rights reserved.
6
 *
7
 * @author Kacper "Kadet" Donat <[email protected]>
8
 *
9
 * Contact with author:
10
 * Xmpp: [email protected]
11
 * E-mail: [email protected]
12
 *
13
 * From Kadet with love.
14
 */
15
16
namespace Kadet\Xmpp\Utils;
17
18
use Interop\Container\ContainerInterface;
19
20
trait ServiceManager
21
{
22
    public function get($id)
23
    {
24
        return $this->getContainer()->get($id);
25
    }
26
27 8
    public function has($id)
28
    {
29 8
        return $this->getContainer()->has($id);
30
    }
31
32
    abstract protected function getContainer() : ContainerInterface;
33
}
34