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.

Writer::write()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
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 Writer implements Writable
10
{
11
    /**
12
    * @var string
13
    */
14
    const MODE = 'w';
15
16
    /**
17
    * @param  string $path
18
    * @param  mixed $data
19
    * @return void
20
    */
21
    public function write($path, $data)
22
    {
23
        if (!$resource = @fopen($path, self::MODE)) {
24
            throw new CannotWriteException();
25
        }
26
27
        fwrite($resource, $data);
28
        fclose($resource);
29
    }
30
}
31