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

StakxResource   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getResource() 0 8 1
A initFileSystem() 0 7 2
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
}