ResourceConfig   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 4
b 0
f 0
dl 0
loc 44
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A registeredSettings() 0 3 1
A getResource() 0 3 1
1
<?php
2
3
namespace LaravelPropertyBag\Settings;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class ResourceConfig
8
{
9
    /**
10
     * Resource that has settings.
11
     *
12
     * @var Model
13
     */
14
    private $resource;
15
16
    /**
17
     * Registered settings for model.
18
     *
19
     * @var array
20
     */
21
    protected $registeredSettings = [];
22
23
    /**
24
     * Construct.
25
     *
26
     * @param Model $resource
27
     */
28
    public function __construct(Model $resource)
29
    {
30
        $this->resource = $resource;
31
    }
32
33
    /**
34
     * Returns resource.
35
     *
36
     * @return Model
37
     */
38
    public function getResource()
39
    {
40
        return $this->resource;
41
    }
42
43
    /**
44
     * Return a collection of registered settings.
45
     *
46
     * @return \Illuminate\Support\Collection
47
     */
48
    public function registeredSettings()
49
    {
50
        return collect($this->registeredSettings);
51
    }
52
}
53