Passed
Push — stable ( f958a0...2a58cd )
by Nuno
04:01
created

GithubStrategy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 16
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDownloadUrl() 0 7 1
1
<?php
2
3
namespace LaravelZero\Framework\Components\Updater;
4
5
use Phar;
6
7
/**
8
 * @internal
9
 */
10
final class GithubStrategy extends \Humbug\SelfUpdate\Strategy\GithubStrategy
11
{
12
    /**
13
     * Returns the Download Url.
14
     *
15
     * @param array $package
16
     *
17
     * @return string
18
     */
19
    protected function getDownloadUrl(array $package): string
20
    {
21
        $downloadUrl = parent::getDownloadUrl($package);
22
23
        $downloadUrl = str_replace('releases/download', 'raw', $downloadUrl);
24
25
        return $downloadUrl . '/builds/' . basename(Phar::running());
26
    }
27
}
28