Completed
Pull Request — master (#18)
by Vladimir
02:19
created

StakxResource::initFileSystem()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace allejo\stakx\System;
4
5
class StakxResource
6
{
7
    /**
8
     * @var Filesystem
9
     */
10
    private static $fs;
11
12
    public static function getResource ($fileName)
13
    {
14
        self::initFileSystem();
15
16
        return file_get_contents(
17
            self::$fs->appendPath(__DIR__, '..', 'Resources', $fileName)
18
        );
19
    }
20
21
    private static function initFileSystem ()
22
    {
23
        if (is_null(self::$fs))
24
        {
25
            self::$fs = new Filesystem();
26
        }
27
    }
28
}