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

PlayerDb::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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