BuilderMacroServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
3
namespace Signifly\BuilderMacros;
4
5
use Illuminate\Support\Collection;
6
use Illuminate\Support\ServiceProvider;
7
8
class BuilderMacroServiceProvider extends ServiceProvider
9
{
10
    public function register()
11
    {
12
        Collection::make(glob(__DIR__.'/macros/*.php'))
0 ignored issues
show
Bug introduced by
glob(__DIR__ . '/macros/*.php') of type array is incompatible with the type Illuminate\Contracts\Support\Arrayable expected by parameter $items of Illuminate\Support\Collection::make(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

12
        Collection::make(/** @scrutinizer ignore-type */ glob(__DIR__.'/macros/*.php'))
Loading history...
13
            ->mapWithKeys(function ($path) {
14
                return [$path => pathinfo($path, PATHINFO_FILENAME)];
15
            })
16
            ->each(function ($macro, $path) {
17
                require_once $path;
18
            });
19
    }
20
}
21