Theme::fullName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Rudolf\Modules\Appearance\One\Admin;
4
5
class Theme
6
{
7
    /**
8
     * @var array Theme data
9
     */
10
    protected $theme;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param array $theme
16
     */
17
    public function __construct(array $theme = [])
18
    {
19
        $this->setData($theme);
20
    }
21
22
    /**
23
     * Set theme data.
24
     *
25
     * @param array $theme
26
     *
27
     * @return array
28
     */
29
    public function setData($theme)
30
    {
31
        $this->theme = array_merge(
32
            [
33
                'id' => 0,
34
                'path' => '',
35
                'name' => '',
36
                'full-name' => '',
37
                'description' => '',
38
                'author' => '',
39
                'version' => '',
40
                'active' => false,
41
            ],
42
            (array) $theme
43
        );
44
45
        return $this->theme;
46
    }
47
48
    public function id()
49
    {
50
        return (int) $this->theme['id'];
51
    }
52
53
    public function path()
54
    {
55
        return $this->theme['path'];
56
    }
57
58
    public function urlPath()
59
    {
60
        return str_replace(APP_ROOT, '', $this->theme['path']);
61
    }
62
63
    public function fullName()
64
    {
65
        return $this->theme['full-name'];
66
    }
67
68
    public function name()
69
    {
70
        return $this->theme['name'];
71
    }
72
73
    public function description()
74
    {
75
        return $this->theme['description'];
76
    }
77
78
    public function author()
79
    {
80
        return $this->theme['author'];
81
    }
82
83
    public function version()
84
    {
85
        return $this->theme['version'];
86
    }
87
88
    public function isActive()
89
    {
90
        return $this->theme['active'];
91
    }
92
}
93