Completed
Push — master ( 8fcc32...ae3918 )
by Innocent
01:13
created

Discussion   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 11 1
1
<?php
2
3
namespace Faithgen\Discussions\Http\Resources;
4
5
class Discussion extends DiscussionList
6
{
7
    public function toArray($request)
8
    {
9
        return array_merge(parent::toArray($request), [
10
            'discussion' => $this->discussion,
11
            'url'        => $this->url,
12
            'comments'   => [
13
                'count' => $this->comments()->count(),
14
            ],
15
            'images'     => Image::collection($this->images),
16
        ]);
17
    }
18
}
19