DomainListResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
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