Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 1 | public function index() |
|
12 | { |
||
13 | 1 | $files = collect(); |
|
14 | 1 | foreach(settings('tags_to_merge', []) as $tag) { |
|
15 | 1 | foreach(File::withTag($tag)->get() as $file) { |
|
16 | 1 | $files->push($file); |
|
17 | } |
||
18 | } |
||
19 | return $files->unique(function(File $file) { |
||
20 | 1 | return $file->id; |
|
21 | })->map(function(File $file) { |
||
22 | 1 | return $file->load(['statuses', 'comments']); |
|
23 | 1 | })->values(); |
|
24 | } |
||
26 | } |