Passed
Push — master ( f6e9eb...632a43 )
by Adam
05:07
created

UserTableService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRouteName() 0 3 1
B getColumns() 0 24 1
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\User;
6
7
class UserTableService implements TableServiceInterface
8
{
9 2
    public function getRouteName()
10
    {
11 2
        return 'user';
12
    }
13
14 2
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 2
                'title' => trans('general.name'),
19 2
                'value' => function (User $data) {
20 1
                    return $data->name;
21 2
                },
22
            ],
23
            [
24 2
                'title' => trans('auth.email'),
25 2
                'value' => function (User $data) {
26 1
                    return $data->email;
27 2
                },
28
            ],
29
            [
30 2
                'title' => trans('general.created'),
31 2
                'value' => function (User $data) {
32 1
                    return $data->created_at;
33 2
                },
34
            ],
35
        ];
36
37 2
        return $dataset;
38
    }
39
}
40