Passed
Branch master (328f34)
by Chubarov
04:39
created

SheduleEmail::getStatusActionHumanAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace agoalofalife\postman\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class SheduleEmail extends Model
9
{
10
    use SoftDeletes;
11
12
    protected $fillable = ['date' , 'email_id', 'mode_id', 'status_action'];
13
14
    /**
15
     * The attributes that should be cast to native types.
16
     *
17
     * @var array
18
     */
19
    protected $casts = [
20
        'status_action' => 'boolean',
21
    ];
22
23
    /**
24
     * Get the status action.
25
     *
26
     * @param  string  $value
27
     * @return string
28
     */
29 1
    public function getStatusActionAttribute($value) : string
30
    {
31 1
        return $value;
32
    }
33
34
    /**
35
     * @param $value
36
     * @return string
37
     */
38 1
    public function getStatusActionHumanAttribute($value) : string
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

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

38
    public function getStatusActionHumanAttribute(/** @scrutinizer ignore-unused */ $value) : string

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
    {
40 1
        return trans("postman::dashboard.status_action." . $this->status_action);
0 ignored issues
show
Bug Best Practice introduced by
The expression return trans('postman::d.... $this->status_action) could return the type Illuminate\Contracts\Tra...n\Translator|null|array which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
41
    }
42
43 3
    public function email()
44
    {
45 3
        return $this->belongsTo(Email::class);
46
    }
47
48 1
    public function mode()
49
    {
50 1
        return $this->belongsTo(ModePostEmail::class);
51
    }
52
}
53