AbstractCachingPackageRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMetadataCacheDirectory() 0 5 1
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