Completed
Pull Request — master (#156)
by Lucas
03:54 queued 01:43
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
2
3
namespace Spatie\CollectionMacros\Macros;
4
5
use Illuminate\Support\Collection;
6
7
class Glob
8
{
9
    /**
10
     * Execute a callable if the collection isn't empty, then return the collection.
11
     *
12
     * @param callable callback
13
     *
14
     * @return \Illuminate\Support\Collection
15
     */
16
    public function glob()
17
    {
18
        return function (string $pattern, int $flags = 0): Collection {
19
            return Collection::make(glob($pattern, $flags));
20
        };
21
    }
22
}
23