Completed
Push — master ( d20415...295400 )
by Ryan
02:56
created

SettingsModuleServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
c 4
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php namespace Anomaly\SettingsModule;
2
3
use Anomaly\SettingsModule\Setting\Command\ConfigureStreams;
4
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
5
use Anomaly\Streams\Platform\Application\Application;
6
7
/**
8
 * Class SettingsModuleServiceProvider
9
 *
10
 * @link          http://pyrocms.com/
11
 * @author        PyroCMS, Inc. <[email protected]>
12
 * @author        Ryan Thompson <[email protected]>
13
 * @package       Anomaly\SettingsModule
14
 */
15
class SettingsModuleServiceProvider extends AddonServiceProvider
16
{
17
18
    /**
19
     * The addon plugins.
20
     *
21
     * @var array
22
     */
23
    protected $plugins = [
24
        'Anomaly\SettingsModule\SettingsModulePlugin'
25
    ];
26
27
    /**
28
     * The addon listeners.
29
     *
30
     * @var array
31
     */
32
    protected $listeners = [
33
        'Anomaly\Streams\Platform\Addon\Module\Event\ModuleWasUninstalled'       => [
34
            'Anomaly\SettingsModule\Setting\Listener\DeleteModuleSettings'
35
        ],
36
        'Anomaly\Streams\Platform\Addon\Extension\Event\ExtensionWasUninstalled' => [
37
            'Anomaly\SettingsModule\Setting\Listener\DeleteExtensionSettings'
38
        ]
39
    ];
40
41
    /**
42
     * The addon routes.
43
     *
44
     * @var array
45
     */
46
    protected $routes = [
47
        'admin/settings'                => 'Anomaly\SettingsModule\Http\Controller\Admin\SystemController@edit',
48
        'admin/settings/{type}'         => 'Anomaly\SettingsModule\Http\Controller\Admin\AddonsController@index',
49
        'admin/settings/{type}/{addon}' => 'Anomaly\SettingsModule\Http\Controller\Admin\AddonsController@edit'
50
    ];
51
52
    /**
53
     * The class bindings.
54
     *
55
     * @var array
56
     */
57
    protected $bindings = [
58
        'Anomaly\Streams\Platform\Model\Settings\SettingsSettingsEntryModel' => 'Anomaly\SettingsModule\Setting\SettingModel'
59
    ];
60
61
    /**
62
     * The singleton bindings.
63
     *
64
     * @var array
65
     */
66
    protected $singletons = [
67
        'Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface' => 'Anomaly\SettingsModule\Setting\SettingRepository'
68
    ];
69
70
    /**
71
     * Configure Streams.
72
     *
73
     * @param Application $application
74
     */
75
    public function boot(Application $application)
76
    {
77
        if (!$application->isInstalled()) {
78
            return;
79
        }
80
81
        $this->dispatch(new ConfigureStreams());
82
    }
83
84
}
85