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

GithubStrategy::getDownloadUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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