Completed
Pull Request — master (#156)
by Lucas
03:54 queued 01:43
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
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