Completed
Pull Request — master (#191)
by De Cramer
38:49 queued 31:55
created

LapDataProvider::isCompatible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace eXpansion\Framework\GameTrackmania\DataProviders;
4
use eXpansion\Framework\Core\DataProviders\AbstractDataProvider;
5
use eXpansion\Framework\Core\Model\CompatibilityCheckDataProviderInterface;
6
use Maniaplanet\DedicatedServer\Structures\Map;
7
8
/**
9
 * Class LapDataProvider
10
 *
11
 * @author    de Cramer Oliver<[email protected]>
12
 * @copyright 2017 Smile
13
 * @package eXpansion\Framework\GameTrackmania\DataProviders
14
 */
15
class LapDataProvider extends AbstractDataProvider implements CompatibilityCheckDataProviderInterface
16
{
17
    /**
18
     * Check if data provider is compatible with current situation.
19
     *
20
     * @return bool
21
     */
22
    public function isCompatible(Map $map): bool
23
    {
24
        return $map->lapRace;
25
    }
26
27 View Code Duplication
    public function onWayPoint($params)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    {
29
        if ($params['isendlap']) {
30
            $this->dispatch(
31
                'onPlayerEndLap',
32
                [
33
                    $params['login'],
34
                    $params['time'],
35
                    $params['laptime'],
36
                    $params['stuntsscore'],
37
                    $params['checkpointinlap'],
38
                    $params['curlapcheckpoints'],
39
                    $params['blockid'],
40
                    $params['speed'],
41
                    $params['distance'],
42
                ]
43
            );
44
        }
45
    }
46
}