CandidatesFinder::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Tworzenieweb\SqlProvisioner\Filesystem;
4
5
use Symfony\Component\Finder\Finder;
6
7
/**
8
 * @author Luke Adamczewski
9
 * @package Tworzenieweb\SqlProvisioner\Filesystem
10
 */
11
class CandidatesFinder
12
{
13
    const FILES_MASK = '/^\d{3,}\_.*\.sql$/';
14
15
16
17
    /**
18
     * @param string $path
19
     * @return Finder
20
     */
21 1
    public function find($path)
22
    {
23 1
        return Finder::create()
24 1
            ->files()
25 1
            ->name(self::FILES_MASK)
26 1
            ->sortByName()
27 1
            ->in($path);
28
    }
29
}
30