FileDownloaderDummy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCacheKeyCompat() 0 11 2
1
<?php
2
/*
3
 * @author Hiraku NAKANO
4
 * @license MIT https://github.com/hirak/prestissimo
5
 */
6
namespace Hirak\Prestissimo;
7
8
use Composer\Package;
9
10
/**
11
 * dirty hack for getCacheKey compatiblity
12
 */
13
class FileDownloaderDummy extends \Composer\Downloader\FileDownloader
14
{
15 1
    public function __construct()
16
    {
17
        // do nothing
18 1
    }
19
20 1
    public static function getCacheKeyCompat(Package\PackageInterface $p, $processedUrl)
21
    {
22 1
        static $rgetCacheKey, $my;
23 1
        if (!$rgetCacheKey) {
24 1
            $rgetCacheKey = new \ReflectionMethod('Composer\Downloader\FileDownloader', 'getCacheKey');
25 1
            $rgetCacheKey->setAccessible(true);
26 1
            $my = new self;
27
        }
28
29 1
        return $rgetCacheKey->invoke($my, $p, $processedUrl);
30
    }
31
}
32