Completed
Push — dev ( 8eacd8...04be10 )
by De Cramer
02:44
created

MatchDataProvider::onEndMatch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace eXpansion\Framework\Core\DataProviders;
4
5
use eXpansion\Framework\Core\Storage\PlayerStorage;
6
use Maniaplanet\DedicatedServer\Connection;
7
use Maniaplanet\DedicatedServer\Structures\Map;
8
9
/**
10
 * ChatDataProvider provides chat information to plugins.
11
 *
12
 * @package eXpansion\Framework\Core\DataProviders
13
 */
14
class MatchDataProvider extends AbstractDataProvider
15
{
16
    /** @var  PlayerStorage */
17
    protected $playerStorage;
18
19
    /** @var  Connection */
20
    protected $connection;
21
22
    /**
23
     * MatchDataProvider constructor.
24
     *
25
     * @param PlayerStorage $playerStorage
26
     * @param Connection $connection
27
     */
28 9
    public function __construct(PlayerStorage $playerStorage, Connection $connection)
29
    {
30 9
        $this->playerStorage = $playerStorage;
31 9
        $this->connection = $connection;
32 9
    }
33
34 1
    public function onBeginMap($map)
35
    {
36 1
        $this->dispatch(__FUNCTION__, [Map::fromArray($map)]);
37 1
    }
38
39 1
    public function onEndMap($map)
40
    {
41
42 1
        $this->dispatch(__FUNCTION__, [Map::fromArray($map)]);
43 1
    }
44
}
45