Completed
Push — master ( 176090...b969a1 )
by Peter
02:10
created

CacheComponent::getFilename()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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 42
	protected function getFilename($className)
20
	{
21 42
		return sprintf("%s/%s.php", $this->basePath, Cacher::classToFile($className));
22
	}
23
24 35
	protected function getPartialsDir($className)
25
	{
26 35
		return sprintf(
27 35
			'%s/%s',
28 35
			$this->basePath,
29 35
			Cacher::classToFile($className)
30
		);
31
	}
32
}