EmailDatatable::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 16
ccs 0
cts 14
cp 0
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php namespace Distilleries\Expendable\Http\Datatables\Email;
2
3
use Distilleries\Expendable\Http\Datatables\BaseDatatable;
4
use Distilleries\Expendable\Helpers\StaticLabel;
5
6
class EmailDatatable extends BaseDatatable {
7
8
    public function build()
9
    {
10
        $this->add('id');
11
        $this->add('libelle', null, trans('expendable::datatable.subject'));
0 ignored issues
show
Bug introduced by
It seems like trans('expendable::datatable.subject') can also be of type array; however, parameter $translation of Distilleries\DatatableBu...loquentDatatable::add() does only seem to accept Symfony\Component\Transl...nslatorInterface|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

11
        $this->add('libelle', null, /** @scrutinizer ignore-type */ trans('expendable::datatable.subject'));
Loading history...
12
        $this->add('body_type', function($model)
13
        {
14
            return StaticLabel::bodyType($model->body_type);
15
        },trans('expendable::datatable.type'));
16
        $this->add('action', function($model)
17
        {
18
            return StaticLabel::mailActions($model->action);
19
        });
20
        $this->add('cc');
21
        $this->add('bcc');
22
        $this->addTranslationAction();
23
        $this->addDefaultAction();
24
    }
25
}