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

ComponentRegistrar::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
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
}