FormsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerAliases() 0 4 1
A register() 0 7 1
A boot() 0 5 1
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
}