Completed
Push — master ( 586b8e...cb0e4b )
by De Cramer
04:39 queued 53s
created

PlayerDb   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
1
<?php
2
3
namespace eXpansion\Framework\PlayersBundle\Storage;
4
5
use \eXpansion\Framework\PlayersBundle\Plugins\Player as PlayerPlugin;
6
7
/**
8
 * Class Player
9
 *
10
 * @author    de Cramer Oliver<[email protected]>
11
 * @copyright 2017 Smile
12
 * @package eXpansion\Framework\PlayersBundle\Storage
13
 */
14
class PlayerDb
15
{
16
    /** @var PlayerPlugin  */
17
    protected $playerPlugin;
18
19
    /**
20
     * Player constructor.
21
     *
22
     * @param PlayerPlugin $playerPlugin
23
     */
24 1
    public function __construct(PlayerPlugin $playerPlugin)
25
    {
26 1
        $this->playerPlugin = $playerPlugin;
27 1
    }
28
29
    /**
30
     * Get stored player. Only currently connected players are stored.
31
     *
32
     * @param $playerLogin
33
     *
34
     * @return mixed|null
35
     */
36 1
    public function get($playerLogin)
37
    {
38 1
        return $this->playerPlugin->getPlayer($playerLogin);
39
    }
40
}
41