Completed
Pull Request — master (#68)
by De Cramer
05:45
created

RecordsDataProvider::onFirstRecord()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
crap 1
1
<?php
2
3
namespace eXpansion\Bundle\LocalRecords\DataProviders;
4
5
use eXpansion\Bundle\LocalRecords\Services\RecordHandler;
6
use eXpansion\Framework\Core\DataProviders\AbstractDataProvider;
7
8
/**
9
 * Class RecordsDataProvider
10
 *
11
 * @package eXpansion\Bundle\LocalRecords\DataProviders;
12
 * @author  oliver de Cramer <[email protected]>
13
 */
14
class RecordsDataProvider extends AbstractDataProvider
15
{
16 1
    public function onRecordsLoaded($params)
17
    {
18 1
        $this->dispatch('onLocalRecordsLoaded', [$params[RecordHandler::COL_RECORDS]]);
19 1
    }
20
21 1
    public function onFirstRecord($params)
22
    {
23 1
        $this->dispatch(
24 1
            'onLocalRecordsFirstRecord',
25
            [
26 1
                $params[RecordHandler::COL_RECORD],
27 1
                $params[RecordHandler::COL_RECORDS],
28 1
                $params[RecordHandler::COL_POS],
29
            ]
30
        );
31 1
    }
32
33 1
    public function onSameScore($params)
34
    {
35 1
        $this->dispatch(
36 1
            'onLocalRecordsSameScore',
37
            [
38 1
                $params[RecordHandler::COL_RECORD],
39 1
                $params[RecordHandler::COL_OLD_RECORD],
40 1
                $params[RecordHandler::COL_RECORDS],
41
            ]
42
        );
43 1
    }
44
45 1 View Code Duplication
    public function onBetterPosition($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...
46
    {
47 1
        $this->dispatch(
48 1
            'onLocalRecordsBetterPosition',
49
            [
50 1
                $params[RecordHandler::COL_RECORD],
51 1
                $params[RecordHandler::COL_OLD_RECORD],
52 1
                $params[RecordHandler::COL_RECORDS],
53 1
                $params[RecordHandler::COL_POS],
54 1
                $params[RecordHandler::COL_OLD_POS],
55
            ]
56
        );
57 1
    }
58
59 1 View Code Duplication
    public function onSamePosition($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...
60
    {
61 1
        $this->dispatch(
62 1
            'onLocalRecordsSamePosition',
63
            [
64 1
                $params[RecordHandler::COL_RECORD],
65 1
                $params[RecordHandler::COL_OLD_RECORD],
66 1
                $params[RecordHandler::COL_RECORDS],
67 1
                $params[RecordHandler::COL_POS],
68
            ]
69
        );
70 1
    }
71
72
}