DomainListResponse::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: marcelwege
5
 * Date: 23.11.17
6
 * Time: 18:58.
7
 */
8
9
namespace App\Siweocs\Models;
10
11
use App\Domain;
12
use Illuminate\Database\Eloquent\Collection;
13
14
class DomainListResponse extends SiwecosBaseReponse
15
{
16
    /**
17
     * @var array
18
     */
19
    public $domains;
20
21
    public function __construct(Collection $domains)
22
    {
23
        parent::__construct('List of all domains');
24
        $this->domains = [];
25
        /** @var Domain $domain */
26
        foreach ($domains as $domain) {
27
            array_push($this->domains, new DomainObjectResponse($domain));
28
        }
29
    }
30
}
31