getMetadataCacheDirectory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
namespace ComponentManager\PackageRepository;
12
13
/**
14
 * Caching package repository base class.
15
 *
16
 * Contains utility methods for use across caching package repositories.
17
 */
18
abstract class AbstractCachingPackageRepository
19
        extends AbstractPackageRepository {
20
    /**
21
     * Cache directory format string.
22
     *
23
     * @var string[]
24
     */
25
    const CACHE_DIRECTORY_FORMAT = ['%s', 'componentmgr', 'cache', '%s'];
26
27
    /**
28
     * Get repository cache directory.
29
     *
30
     * @return string
31
     */
32
    protected function getMetadataCacheDirectory() {
33
        return sprintf(
34
                $this->platform->joinPaths(static::CACHE_DIRECTORY_FORMAT),
35
                $this->platform->getLocalSharedDirectory(), $this->getId());
36
    }
37
}
38