CacheComponent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 23
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFilename() 0 4 1
A getPartialsDir() 0 8 1
1
<?php
2
3
4
namespace Maslosoft\Addendum\Cache\PhpCache;
5
6
7
use Maslosoft\Addendum\Helpers\Cacher;
8
use function sprintf;
9
10
class CacheComponent
11
{
12
	protected $basePath = '';
13
14 5
	public function __construct($basePath)
15
	{
16 5
		$this->basePath = $basePath;
17 5
	}
18
19 41
	protected function getFilename($className)
20
	{
21 41
		return sprintf("%s/%s.php", $this->basePath, Cacher::classToFile($className));
22
	}
23
24 34
	protected function getPartialsDir($className)
25
	{
26 34
		return sprintf(
27 34
			'%s/%s',
28 34
			$this->basePath,
29 34
			Cacher::classToFile($className)
30
		);
31
	}
32
}