Completed
Push — master ( b1c4b6...a05019 )
by Şəhriyar
19s
created

UserActivation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 3
c 1
b 1
f 1
lcom 1
cbo 1
dl 0
loc 35
ccs 0
cts 7
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCompleted() 0 4 1
A setCompleted() 0 4 1
A getCode() 0 4 1
1
<?php namespace App\Models;
2
3
use Illuminate\Database\Eloquent\Model;
4
5
/**
6
 * App\Models\UserActivation
7
 *
8
 * @mixin \Eloquent
9
 * @property integer        $id
10
 * @property integer        $user_id
11
 * @property string         $code
12
 * @property boolean        $completed
13
 * @property string         $completed_at
14
 * @property \Carbon\Carbon $created_at
15
 * @property \Carbon\Carbon $updated_at
16
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereId($value)
17
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereUserId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCode($value)
19
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCompleted($value)
20
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCompletedAt($value)
21
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCreatedAt($value)
22
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereUpdatedAt($value)
23
 */
24
class UserActivation extends Model
25
{
26
    protected $table = 'users_activations';
27
28
    protected $fillable = [
29
        'code',
30
        'completed',
31
        'completed_at',
32
    ];
33
34
    /**
35
     * @param  mixed $completed
36
     *
37
     * @return bool
38
     */
39
    public function getCompleted($completed)
40
    {
41
        return (bool)$completed;
42
    }
43
44
    /**
45
     * @param  mixed $completed
46
     *
47
     * @return void
48
     */
49
    public function setCompleted($completed)
50
    {
51
        $this->attributes['completed'] = (bool)$completed;
52
    }
53
54
    public function getCode()
55
    {
56
        return $this->attributes['code'];
57
    }
58
}
59