Completed
Push — 2.0 ( 059513...f86834 )
by Nicolas
02:08
created

SettingDirective   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A show() 0 6 1
A extractArguments() 0 6 1
1
<?php
2
3
namespace Modules\Setting\Blade;
4
5
final class SettingDirective
6
{
7
    /**
8
     * @var string
9
     */
10
    private $settingName;
11
    /**
12
     * @var string
13
     */
14
    private $locale;
15
    /**
16
     * @var string Default value
17
     */
18
    private $default;
19
20
    /**
21
     * @param $arguments
22
     */
23
    public function show($arguments)
24
    {
25
        $this->extractArguments($arguments);
26
27
        return setting($this->settingName, $this->locale, $this->default);
28
    }
29
30
    /**
31
     * @param array $arguments
32
     */
33
    private function extractArguments(array $arguments)
34
    {
35
        $this->settingName = array_get($arguments, 0);
36
        $this->locale = array_get($arguments, 1);
37
        $this->default = array_get($arguments, 2);
38
    }
39
}
40