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

GuestTableService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getColumns() 0 36 1
A getRouteName() 0 3 1
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\Guest;
6
7
class GuestTableService implements TableServiceInterface
8
{
9 5
    public function getRouteName()
10
    {
11 5
        return 'guest';
12
    }
13
14 4
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 4
                'title' => trans('general.first_name'),
19 4
                'value' => function (Guest $data) {
20 2
                    return $data->first_name;
21 4
                },
22
            ],
23
            [
24 4
                'title' => trans('general.last_name'),
25 4
                'value' => function (Guest $data) {
26 2
                    return $data->last_name;
27 4
                },
28
            ],
29
            [
30 4
                'title' => trans('general.address'),
31 4
                'value' => function (Guest $data) {
32 2
                    return $data->address.', '.$data->zip_code.' '.$data->place;
33 4
                },
34
            ],
35
            [
36 4
                'title' => trans('general.PESEL'),
37 4
                'value' => function (Guest $data) {
38 2
                    return $data->PESEL;
39 4
                },
40
            ],
41
            [
42 4
                'title' => trans('general.contact'),
43 4
                'value' => function (Guest $data) {
44 2
                    return $data->contact;
45 4
                },
46
            ],
47
        ];
48
49 4
        return $dataset;
50
    }
51
}
52