CacheStatic   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
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