Completed
Push — master ( 785bde...8b4d11 )
by Freek
01:29
created

Glob   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
3
namespace Spatie\CollectionMacros\Macros;
4
5
use Illuminate\Support\Collection;
6
7
/*
8
 * Execute a callable if the collection isn't empty, then return the collection.
9
 *
10
 * @param callable callback
11
12
 * @return \Illuminate\Support\Collection
13
 */
14
class Glob
15
{
16
    public function __invoke()
17
    {
18
        return function (string $pattern, int $flags = 0): Collection {
19
            return Collection::make(glob($pattern, $flags));
20
        };
21
    }
22
}
23