Completed
Push — master ( 20a6e3...887da8 )
by Abdelrahman
04:09 queued 02:12
created

GuardiansDataTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 13 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Auth\DataTables\Adminarea;
6
7
use Cortex\Auth\Models\Guardian;
8
use Cortex\Foundation\DataTables\AbstractDataTable;
9
use Cortex\Auth\Transformers\Guardianarea\Adminarea\GuardianTransformer;
10
11
class GuardiansDataTable extends AbstractDataTable
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    protected $model = Guardian::class;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $transformer = GuardianTransformer::class;
22
23
    /**
24
     * Get columns.
25
     *
26
     * @return array
27
     */
28
    protected function getColumns(): array
29
    {
30
        $link = config('cortex.foundation.route.locale_prefix')
31
            ? '"<a href=\""+routes.route(\'adminarea.guardians.edit\', {guardian: full.id, locale: \''.$this->request->segment(1).'\'})+"\">"+data+"</a>"'
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 154 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
            : '"<a href=\""+routes.route(\'adminarea.guardians.edit\', {guardian: full.id})+"\">"+data+"</a>"';
33
34
        return [
35
            'username' => ['title' => trans('cortex/auth::common.username'), 'render' => $link.'+(full.is_active ? " <i class=\"text-success fa fa-check\"></i>" : " <i class=\"text-danger fa fa-close\"></i>")', 'responsivePriority' => 0],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 238 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
            'email' => ['title' => trans('cortex/auth::common.email')],
37
            'created_at' => ['title' => trans('cortex/auth::common.created_at'), 'render' => "moment(data).format('YYYY-MM-DD, hh:mm:ss A')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 142 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/auth::common.updated_at'), 'render' => "moment(data).format('YYYY-MM-DD, hh:mm:ss A')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 142 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