Passed
Push — master ( c7007b...6716c0 )
by Quim González
04:47
created

Task   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 10 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Task extends Model
8
{
9
    protected $fillable = ['name', 'user_id', 'description'];
10
11
    public function toArray()
12
    {
13
        return [
14
            'id' => $this->id,
15
            'name' => $this->name,
16
            'description' => $this->description,
17
            'user_id' => $this->user_id,
18
            'completed' => $this->completed? true:false,
19
            'created_at' => $this->created_at."",
20
            'updated_at' => $this->updated_at."",
21
        ];
22
    }
23
}
24