Completed
Push — master ( e85f0f...a6d11a )
by Ryan
02:21
created

PreferencesModulePlugin::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\PreferencesModule;
2
3
use Anomaly\PreferencesModule\Preference\Command\GetPreferenceValue;
4
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
5
6
/**
7
 * Class PreferencesModulePlugin
8
 *
9
 * @link          http://anomaly.is/streams-platform
10
 * @author        AnomalyLabs, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 * @package       Anomaly\PreferencesModule
13
 */
14
class PreferencesModulePlugin 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
                'preference_value',
27
                function ($key) {
28
                    return $this->dispatch(new GetPreferenceValue($key));
29
                }
30
            )
31
        ];
32
    }
33
}
34