HealthCheckCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A __construct() 0 3 1
1
<?php
2
namespace Health\Resources;
3
4
use Illuminate\Http\Resources\Json\ResourceCollection;
5
6
/**
7
 * HealthCheck Collection
8
 */
9
class HealthCheckCollection extends ResourceCollection
10
{
11
12
    /**
13
     *
14
     * @param array $resource
15
     */
16
    public function __construct($resource)
17
    {
18
        parent::__construct(collect($resource));
19
    }
20
21
    /**
22
     *
23
     * {@inheritdoc}
24
     * @see \Illuminate\Http\Resources\Json\ResourceCollection::toArray()
25
     */
26
    public function toArray($request)
27
    {
28
        return $this->collection->transform(function ($item) {
29
            return new HealthCheck($item);
30
        })->values();
31
    }
32
}
33