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.

Config::makeBinDirectory()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Youtubedl;
4
5
class Config
6
{
7
    public static function removeBinDirectory()
8
    {
9
        if (self::binExists()) {
10
            unlink(self::getBinFile());
11
            unlink(self::getBinFile().'.exe');
12
        }
13
        if (self::binDirectoryExists()) {
14
            rmdir(self::getBinDirectory());
15
        }
16
    }
17
18
    public static function makeBinDirectory()
19
    {
20
        if (!self::binDirectoryExists()) {
21
            mkdir(self::getBinDirectory());
22
        }
23
    }
24
25
    public static function binExists()
26
    {
27
        return file_exists(self::getBinFile());
28
    }
29
30
    public static function binDirectoryExists()
31
    {
32
        $binDirectory = self::getBinDirectory();
33
        if (file_exists($binDirectory) && is_dir($binDirectory)) {
34
            return true;
35
        }
36
37
        return false;
38
    }
39
40
    public static function getBinDirectory()
41
    {
42
        $rootDirectory = realpath(__DIR__.'/../../');
43
44
        return "{$rootDirectory}/bin";
45
    }
46
47
    public static function getBinFile()
48
    {
49
        return self::getBinDirectory().'/Youtubedl';
50
    }
51
}
52