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

SettingsModulePlugin::getFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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