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.

File   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A open() 0 10 2
1
<?php
2
/**
3
 * Pimf
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
9
namespace Pimf\Adapter;
10
11
use Pimf\Contracts\Streamable;
12
13
/**
14
 * Class File binds a named resource, specified by filename, to a stream.
15
 *
16
 * @package Pimf\Adapter
17
 */
18
class File implements Streamable
19
{
20
    /**
21
     * Use better the local TMP dir or dir with mod 777
22
     * @var string
23
     */
24
    protected $storageDir;
25
26
    /**
27
     * @var string
28
     */
29
    protected $fileName;
30
31
    /**
32
     * Specifies the type of access you require to the stream
33
     * @see http://php.net/manual/en/function.fopen.php#mode
34
     * @var string
35
     */
36
    protected $mode;
37
38
    /**
39
     * @param string $storageDir
40
     * @param string $fileName
41
     * @param string $mode
42
     */
43
    public function __construct($storageDir, $fileName = "pimf-logs.txt", $mode = "at+")
44
    {
45
        $this->storageDir = $storageDir;
46
        $this->fileName = $fileName;
47
        $this->mode = $mode;
48
    }
49
50
    /* @inheritdoc */
51
    public function open()
52
    {
53
        if (!is_dir($this->storageDir)) {
54
            mkdir($this->storageDir, 0777);
55
        }
56
57
        $this->storageDir = rtrim(realpath($this->storageDir), '\\/') . DS;
58
59
        return fopen($this->storageDir . $this->fileName, $this->mode);
60
    }
61
}
62