Completed
Push — develop ( 6bafca...f173d1 )
by Abdelrahman
01:52
created

UsersDataTable::getColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Fort\DataTables\Backend;
6
7
use Cortex\Fort\Models\User;
8
use Cortex\Foundation\DataTables\AbstractDataTable;
9
use Cortex\Fort\Transformers\Backend\UserTransformer;
10
11
class UsersDataTable extends AbstractDataTable
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    protected $model = User::class;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $transformer = UserTransformer::class;
22
23
    /**
24
     * Get columns.
25
     *
26
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,array>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
27
     */
28
    protected function getColumns()
29
    {
30
        return [
31
            'username' => ['title' => trans('cortex/fort::common.username'), 'render' => '"<a href=\""+routes.route(\'backend.users.edit\', {user: full.id})+"\">"+data+"</a>"', 'responsivePriority' => 0],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 204 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
32
            'first_name' => ['title' => trans('cortex/fort::common.first_name')],
33
            'last_name' => ['title' => trans('cortex/fort::common.last_name')],
34
            'email' => ['title' => trans('cortex/fort::common.email'), 'render' => 'data+(data ? "&nbsp;&nbsp;"+(full.email_verified ? "<i class=\"text-success fa fa-check\" title=\""+full.email_verified_at+"\"></i>" : "<i class=\"text-danger fa fa-close\"></i>") : "")'],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 272 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
35
            'phone' => ['title' => trans('cortex/fort::common.phone'), 'render' => 'data+(data ? "&nbsp;&nbsp;"+(full.phone_verified ? "<i class=\"text-success fa fa-check\" title=\""+full.phone_verified_at+"\"></i>" : "<i class=\"text-danger fa fa-close\"></i>") : "")'],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 272 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
36
            'country' => ['title' => trans('cortex/fort::common.country'), 'orderable' => false, 'searchable' => false],
37
            'created_at' => ['title' => trans('cortex/fort::common.created_at'), 'width' => '15%', 'render' => "moment(data).format('MMM Do, YYYY')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 150 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
38
            'updated_at' => ['title' => trans('cortex/fort::common.updated_at'), 'width' => '15%', 'render' => "moment(data).format('MMM Do, YYYY')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 150 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
39
        ];
40
    }
41
}
42