Completed
Push — master ( dc6f94...d4342e )
by Alessandro
06:08
created

FileHelper::findFiles()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3
Metric Value
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 9.4286
cc 3
eloc 7
nc 4
nop 2
crap 3
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: Alessandro
6
 * Date: 02/12/2015
7
 * Time: 13:12
8
 */
9
10
11
namespace Padosoft\LaravelComposerSecurity;
12
13
use \Illuminate\Foundation;
14
use \Illuminate\Support\Facades\File;
15
16
class FileHelper
17
{
18
    /**
19
     * @param $path
20
     * @param $fileName
21
     * @return array
22
     */
23 4
    public function findFiles($path, $fileName)
24
    {
25 4
        if ($path=='') {
26 2
            $path = base_path();
27 2
        }
28
29 4
        if (File::isDirectory($path)) {
30 4
            $path=str_finish($path, '/');
31
32 4
        }
33 4
        $path .= $fileName;
34
35 4
        return File::glob($path);
36
    }
37
}