Completed
Push — develop ( 043012...3d7377 )
by Vladimir
12s queued 10s
created

FilesystemLoader::__callStatic()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.1481

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 9
ccs 4
cts 6
cp 0.6667
crap 2.1481
rs 9.9666
c 0
b 0
f 0
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 \bool isVFS(\string $path)                      Check whether a given path is on the virtual filesystem.
18
 * @method static FilesystemPath path(\string $path)              Build a cross-platform ready filesystem path.
19
 * @method static \bool realpath(\string $path)                   A vfsStream friendly way of getting the realpath() of something.
20
 * @method static \string removeExtension(\string $path)          Get the full path to the file without the extension.
21
 */
22
abstract class FilesystemLoader
23
{
24
    private static $fs;
25
26 187
    public static function __callStatic($name, $arguments)
27
    {
28 187
        if (self::$fs === null)
29 187
        {
30
            self::$fs = new Filesystem();
31
        }
32
33 187
        return call_user_func_array([self::$fs, $name], $arguments);
34
    }
35
}
36