UserTableService::getColumns()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 24
ccs 11
cts 11
cp 1
crap 1
rs 9.9
c 1
b 1
f 0
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\User;
6
7
class UserTableService implements TableServiceInterface
8
{
9 9
    public function getRouteName()
10
    {
11 9
        return 'user';
12
    }
13
14 4
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 4
                'title' => trans('general.name'),
19
                'value' => function (User $data) {
20 3
                    return $data->name;
21 4
                },
22
            ],
23
            [
24 4
                'title' => trans('auth.email'),
25
                'value' => function (User $data) {
26 3
                    return $data->email;
27 4
                },
28
            ],
29
            [
30 4
                'title' => trans('general.created'),
31
                'value' => function (User $data) {
32 3
                    return $data->created_at;
33 4
                },
34
            ],
35
        ];
36
37 4
        return $dataset;
38
    }
39
}
40