GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FileFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildFromFile() 0 11 2
1
<?php
2
3
4
5
namespace Katten\Purge\Factory;
6
7
8
use Katten\Purge\Exceptions\UnableToReadInFileException;
9
10
11
12
class FileFactory extends Factory {
13
14
15
    /**
16
     * Retrieve the contents of a file
17
     * 
18
     * @param string $file
19
     *      The file name or url to load from
20
     * 
21
     * @return string
22
     *      The contents of the file
23
     */ 
24
    public static function buildFromFile($file) {
25
    
26
        $output = @file_get_contents($file);
27
        
28
        
29
        if (!$output) {
30
            throw new UnableToReadInFileException("Unable to load file: $file");
31
        }
32
        
33
        return $output;
34
    }
35
36
37
}
38