Completed
Push — master ( fa257f...84e799 )
by Adam
05:01
created

RoomTableService::getColumns()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 22
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 17
nc 1
nop 0
dl 0
loc 36
ccs 22
cts 22
cp 1
crap 1
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\Room;
6
7
class RoomTableService implements TableServiceInterface
8
{
9 5
    public function getRouteName()
10
    {
11 5
        return 'room';
12
    }
13
14 4
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 4
                'title' => trans('general.number'),
19 4
                'value' => function (Room $data) {
20 2
                    return $data->number;
21 4
                },
22
            ],
23
            [
24 4
                'title' => trans('general.floor'),
25 4
                'value' => function (Room $data) {
26 2
                    return $data->floor;
27 4
                },
28
            ],
29
            [
30 4
                'title' => trans('general.capacity'),
31 4
                'value' => function (Room $data) {
32 2
                    return $data->capacity;
33 4
                },
34
            ],
35
            [
36 4
                'title' => trans('general.price'),
37 4
                'value' => function (Room $data) {
38 2
                    return $data->price;
39 4
                },
40
            ],
41
            [
42 4
                'title' => trans('general.comment'),
43 4
                'value' => function (Room $data) {
44 2
                    return $data->comment;
45 4
                },
46
            ],
47
        ];
48
49 4
        return $dataset;
50
    }
51
}
52