Passed
Push — main ( bb1b57...8a5486 )
by Roman
04:07 queued 01:58
created

ComponentRegistrar   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
3
namespace KielD01\LaravelMaterialDashboardPro\View\Components;
4
5
use Illuminate\Support\Facades\Blade;
6
use KielD01\LaravelMaterialDashboardPro\View\Components\Widgets\CardWidget;
7
8
final class ComponentRegistrar
9
{
10
    private array $components = [
11
        CardWidget::class
12
    ];
13
14
    public function register(): void
15
    {
16
        array_map(
17
            fn(string $class) => Blade::component(
18
                forward_static_call(
19
                    sprintf('%s::getComponentName', $class)
20
                ),
21
                $class
22
            ),
23
            $this->components
24
        );
25
    }
26
}