Completed
Pull Request — master (#66)
by Vladimir
02:59
created

FilesystemLoader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 9 2
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Filesystem;
9
10
/**
11
 * @method static \string absolutePath(\string ...$pathFragments) Build an absolute file or directory path separated by the OS specific directory separator.
12
 * @method static \bool exists(\string $path)                     Check whether a given file path exists or not.
13
 * @method static \string getExtension(\string $path)             Get the extension of a given file.
14
 * @method static \string getInternalResource(\string $file)      Get the contents of a stakx resource file.
15
 * @method static \string getFolderPath(\string $path)            Get the parent directory of a given file.
16
 * @method static \string getRelativePath(\string $path)          Strip the current working directory from an absolute path.
17
 * @method static FilesystemPath path(\string $path)              Build a cross-platform ready filesystem path.
18
 * @method static \string removeExtension(\string $path)          Get the full path to the file without the extension.
19
 */
20
abstract class FilesystemLoader
21
{
22
    private static $fs;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $fs. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
23
24 118
    public static function __callStatic($name, $arguments)
25
    {
26 118
        if (self::$fs === null)
27 118
        {
28
            self::$fs = new Filesystem();
29
        }
30
31 118
        return call_user_func_array([self::$fs, $name], $arguments);
32 6
    }
33
}
34