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

Glob::glob()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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