Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3.0067 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | 2 | public static function getCacheKeyCompat(Package\PackageInterface $p, $processedUrl) |
|
19 | { |
||
20 | 2 | static $rgetCacheKey, $my, $params; |
|
21 | 2 | if (!$rgetCacheKey) { |
|
22 | 1 | $rgetCacheKey = new \ReflectionMethod('Composer\Downloader\FileDownloader', 'getCacheKey'); |
|
23 | 1 | $rgetCacheKey->setAccessible(true); |
|
24 | 1 | $my = new self; |
|
25 | 1 | $params = count($rgetCacheKey->getParameters()); |
|
26 | 1 | } |
|
27 | 2 | if ($params === 1) { |
|
28 | 2 | return $rgetCacheKey->invoke($my, $p); |
|
29 | } |
||
30 | |||
31 | return $rgetCacheKey->invoke($my, $p, $processedUrl); |
||
32 | } |
||
33 | } |
||
34 |