Completed
Pull Request — master (#156)
by Lucas
02:36
created

Glob   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

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