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.

Reader::read()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Jamal\JenkinsArduino\Serial;
4
5
/**
6
 * @author Caio Almeida <[email protected]>
7
 * @author Gustavo Lira <[email protected]>
8
 */
9
class Reader implements Readable
10
{
11
    /**
12
     * @var string
13
     */
14
    const MODE = 'r';
15
16
    /**
17
     * @param  path $path
18
     * @return mixed
19
     */
20
    public function read($path)
21
    {
22
        if (!$resource = @fopen($path, self::MODE)) {
23
            throw new InvalidResourceException();
24
        }
25
26
        $resourceData = stream_get_meta_data($resource);
27
28
        return fread($resource, filesize($resourceData['uri']));
29
    }
30
}
31