FormBladeComponentsServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 2
A boot() 0 4 1
A registerBladeComponents() 0 7 1
A registerPublishing() 0 6 1
1
<?php
2
3
namespace Mydnic\FormBladeComponents;
4
5
use Illuminate\Support\Facades\Blade;
6
use Illuminate\Support\Facades\Route;
7
use Illuminate\Support\ServiceProvider;
8
9
class FormBladeComponentsServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any package services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->registerPublishing();
20
        }
21
    }
22
23
    public function boot()
24
    {
25
        $this->registerBladeComponents();
26
    }
27
28
    private function registerBladeComponents()
29
    {
30
        Blade::aliasComponent('components.form.input', 'input');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
31
        Blade::aliasComponent('components.form.textarea', 'textarea');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
        Blade::aliasComponent('components.form.select', 'select');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
33
        Blade::aliasComponent('components.form.checkbox', 'checkbox');
0 ignored issues
show
Bug introduced by
The method aliasComponent() does not exist on Illuminate\Support\Facades\Blade. Did you maybe mean component()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
34
    }
35
36
    public function registerPublishing()
37
    {
38
        $this->publishes([
39
            __DIR__ . '/../resources/views/components' => resource_path('views/components'),
40
        ], 'blade-components');
41
    }
42
}
43