Task   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

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', 'description', 'user_id', 'completed'];
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