FileContentsRetriever::fileGetContents()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
namespace ConfigTree\FileParsing\Reading;
3
4
use ConfigTree\Exception\FileNotReadable;
5
6
class FileContentsRetriever
7
{
8
    /**
9
     * @throws FileNotReadable
10
     */
11
    public function fileGetContents(string $path) : string
12
    {
13
        if (!is_readable($path)) {
14
            throw FileNotReadable::constructWithPath($path);
15
        }
16
        return file_get_contents($path);
17
    }
18
}
19