ResourceConfig::getResource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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