Completed
Push — master ( 934cdf...8f45fc )
by Johnny
01:43
created

FileInfo   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFileHash() 0 7 2
1
<?php
2
namespace Redbox\Scan\Filesystem;
3
4
/**
5
 * Provide a hashing facility so we can compare files.
6
 *
7
 * @package Redbox\Scan\Filesystem
8
 */
9
class FileInfo
10
{
11
    /**
12
     * Return a hash of a given file.
13
     *
14
     * @param string $file
15
     * @return string
16
     */
17 24
    public static function getFileHash($file = "")
18
    {
19 24
        if (file_exists($file) === true) {
20 20
            return md5_file($file);
21
        }
22 4
        return '';
23
    }
24
}