TablescoresSerializer::collection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace App\Serializers\Tournament;
4
5
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
6
use Illuminate\Support\Collection;
7
8
/**
9
 * Class TablescoresSerializer
10
 * @package App\Serializers\Tournament
11
 */
12
class TablescoresSerializer
13
{
14
    /**
15
     * @name collection
16
     * @param EloquentCollection $collection
17
     * @return mixed
18
     */
19
    public function collection(EloquentCollection $collection)
20
    {
21
        $tournament = $collection->first()->tournament;
22
23
        return $tournament->getScore($collection);
24
    }
25
}
26