CacheStatic::get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 4
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Bavix\AdvancedHtmlDom\CacheSystem;
4
5
class CacheStatic implements InterfaceCache
6
{
7
8
    /**
9
     * @var array
10
     */
11
    protected static $cache = [];
12
13
    /**
14
     * @param $url
15
     *
16
     * @return mixed
17
     */
18
    public function get($url)
19
    {
20
        if (!isset(self::$cache[$url])) {
21
            self::$cache[$url] = \file_get_contents($url);
22
        }
23
24
        return self::$cache[$url];
25
    }
26
27
}
28