Completed
Push — master ( 22c9ee...fb83d3 )
by Ryan
02:22
created

SettingsModulePlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 11 1
1
<?php namespace Anomaly\SettingsModule;
2
3
use Anomaly\SettingsModule\Setting\Command\GetSettingValue;
4
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
5
6
/**
7
 * Class SettingsModulePlugin
8
 *
9
 * @link          http://anomaly.is/streams-platform
10
 * @author        AnomalyLabs, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 * @package       Anomaly\SettingsModule
13
 */
14
class SettingsModulePlugin extends Plugin
15
{
16
17
    /**
18
     * Get the functions.
19
     *
20
     * @return array
21
     */
22
    public function getFunctions()
23
    {
24
        return [
25
            new \Twig_SimpleFunction(
26
                'setting_value',
27
                function ($key, $default = null) {
28
                    return $this->dispatch(new GetSettingValue($key, $default));
29
                }
30
            )
31
        ];
32
    }
33
}
34