FileGetContents   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B __invoke() 0 24 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Marcosh\Effector\Effect\File;
6
7
final class FileGetContents
8
{
9
    /**
10
     * @param string $fileName
11
     * @return string|bool may return false on failure
12
     */
13
    public function __invoke(
14
        string $fileName,
15
        ?bool $useIncludePath = false,
16
        ?resource $context = null,
17
        int $offset = 0,
18
        ?int $maxLength = null
19
    ) {
20
        if (null === $maxLength) {
21
            return file_get_contents(
22
                $fileName,
23
                $useIncludePath,
24
                $context,
25
                $offset
26
            );
27
        }
28
29
        return file_get_contents(
30
            $fileName,
31
            $useIncludePath,
32
            $context,
33
            $offset,
34
            $maxLength
35
        );
36
    }
37
}
38