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
Pull Request — master (#23)
by
unknown
04:37 queued 19s
created

Filesystem   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 73.32%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 69
ccs 11
cts 15
cp 0.7332
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A mkdir() 0 4 1
A exists() 0 4 1
A remove() 0 4 1
A dumpFile() 0 4 1
A getDelegate() 0 8 2
1
<?php
2
3
namespace MyWheels\TwigSpreadsheetBundle\Helper;
4
5
use Symfony\Component\Filesystem\Exception\IOException;
6
use Symfony\Component\Filesystem\Filesystem as BaseFilesystem;
7
8
/**
9
 * Class Filesystem.
10
 */
11
class Filesystem
12
{
13
    /**
14
     * @var BaseFilesystem
15
     */
16
    private static $delegate;
17
18
    /**
19
     * Creates a directory recursively.
20
     *
21
     * @param string|array|\Traversable $dirs The directory path
22
     * @param int                       $mode The directory mode
23
     *
24
     * @throws IOException On any directory creation failure
25
     */
26
    public static function mkdir($dirs, int $mode = 0777)
27
    {
28
        self::getDelegate()->mkdir($dirs, $mode);
29
    }
30
31
    /**
32
     * Checks the existence of files or directories.
33
     *
34
     * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
35
     *
36
     * @return bool true if the file exists, false otherwise
37
     */
38 14
    public static function exists($files): bool
39
    {
40 14
        return self::getDelegate()->exists($files);
41
    }
42
43
    /**
44
     * Removes files or directories.
45
     *
46
     * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
47
     *
48
     * @throws IOException When removal fails
49
     */
50
    public static function remove($files)
51
    {
52
        self::getDelegate()->remove($files);
53
    }
54
55
    /**
56
     * Atomically dumps content into a file.
57
     *
58
     * @param string $filename The file to be written to
59
     * @param string $content  The data to write into the file
60
     *
61
     * @throws IOException If the file cannot be written to
62
     */
63 97
    public static function dumpFile(string $filename, string $content)
64
    {
65 97
        self::getDelegate()->dumpFile($filename, $content);
66 97
    }
67
68
    /**
69
     * @return BaseFilesystem
70
     */
71 97
    public static function getDelegate(): BaseFilesystem
72
    {
73 97
        if (!self::$delegate) {
74
            self::$delegate = new BaseFilesystem();
75
        }
76
77 97
        return self::$delegate;
78
    }
79
}
80