Completed
Push — develop ( fd6fdd...e2e6ec )
by Abdelrahman
01:24
created

ContactsDataTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 20 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Contacts\DataTables\Tenantarea;
6
7
use Rinvex\Contacts\Contracts\ContactContract;
8
use Cortex\Foundation\DataTables\AbstractDataTable;
9
use Cortex\Contacts\Transformers\Tenantarea\ContactTransformer;
10
11
class ContactsDataTable extends AbstractDataTable
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    protected $model = ContactContract::class;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $transformer = ContactTransformer::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
        $link = config('cortex.foundation.route.locale_prefix')
31
            ? '"<a href=\""+routes.route(\'tenantarea.contacts.edit\', {contact: 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 153 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(\'tenantarea.contacts.edit\', {contact: full.id})+"\">"+data+"</a>"';
33
34
        return [
35
            'first_name' => ['title' => trans('cortex/contacts::common.first_name'), 'render' => $link, 'responsivePriority' => 0],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 131 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
            'middle_name' => ['title' => trans('cortex/contacts::common.middle_name')],
37
            'last_name' => ['title' => trans('cortex/contacts::common.last_name')],
38
            'email' => ['title' => trans('cortex/contacts::common.email')],
39
            'phone' => ['title' => trans('cortex/contacts::common.phone')],
40
            'country_code' => ['title' => trans('cortex/contacts::common.country')],
41
            'language_code' => ['title' => trans('cortex/contacts::common.language')],
42
            'source' => ['title' => trans('cortex/contacts::common.source')],
43
            'method' => ['title' => trans('cortex/contacts::common.method')],
44
            'created_at' => ['title' => trans('cortex/contacts::common.created_at'), 'render' => "moment(data).format('MMM Do, YYYY')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 136 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...
45
            'updated_at' => ['title' => trans('cortex/contacts::common.updated_at'), 'render' => "moment(data).format('MMM Do, YYYY')"],
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 136 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...
46
        ];
47
    }
48
}
49