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

FileHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findFiles() 0 14 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
}