RoomTableService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
dl 0
loc 43
ccs 19
cts 19
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRouteName() 0 3 1
A getColumns() 0 36 1
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