FluentParameters   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 4
1
<?php
2
3
namespace Yajra\CMS\Entities\Traits;
4
5
use Illuminate\Support\Collection;
6
use Illuminate\Support\Fluent;
7
8
class FluentParameters extends Fluent
9
{
10
    /**
11
     * @var \Illuminate\Support\Collection
12
     */
13
    protected $templates;
14
15
    /**
16
     * FluentParameters constructor.
17
     *
18
     * @param array|object $attributes
19
     */
20
    public function __construct($attributes)
21
    {
22
        parent::__construct($attributes);
23
24
        if (isset($attributes['templates']) && is_array($attributes['templates'])) {
25
            $templates = new Collection;
26
            foreach ($attributes['templates'] as $template) {
27
                $templates->push(new Fluent($template));
28
            }
29
30
            $this->templates = $templates;
31
        }
32
    }
33
}
34