FormsServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Code4\Forms;
4
5
use Illuminate\Foundation\AliasLoader;
6
use Illuminate\Support\ServiceProvider;
7
8
class FormsServiceProvider extends ServiceProvider {
9
10
    public function register() {
11
        $this->app->singleton('formsFactory', function($app) {
12
            return new FormsFactory($app);
13
        });
14
15
        $this->registerAliases();
16
    }
17
18
    public function boot()
19
    {
20
        //$this->publishes([__DIR__ . '/../config/menu.php' => base_path('config/menu.php')], 'config');
21
        $this->loadViewsFrom(__DIR__ . '/../views', 'forms');
22
    }
23
24
25
    private function registerAliases() {
26
        $aliasLoader = AliasLoader::getInstance();
27
        $aliasLoader->alias('FormsFactory', Facades\FormsFactory::class);
28
    }
29
30
}