RoomTableService::getRouteName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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