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.
Test Failed
Push — master ( 31f734...513d45 )
by Anton
06:23
created

PersistentCollection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A load() 0 4 1
A flush() 0 8 2
1
<?php declare(strict_types=1);
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Collection;
9
10
class PersistentCollection extends Collection
11
{
12
    private $file;
13
14
    public function __construct(string $file, array $collection = [])
15
    {
16
        $this->file = $file;
17
        parent::__construct($collection);
18
    }
19
20
    public function load()
21
    {
22
        $this->values = unserialize(file_get_contents($this->file));
23
    }
24
25
    public function flush()
26
    {
27
        $dir = dirname($this->file);
28
        if (!is_dir($dir)) {
29
            mkdir($dir, 0777, true);
30
        }
31
        file_put_contents($this->file, serialize($this->values));
32
    }
33
}
34