Conditions | 4 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 10 | public function generateCompareUrl($sourceUrlFrom, Version $versionFrom, $sourceUrlTo, Version $versionTo) |
|
41 | { |
||
42 | // Check if both urls come from the supported domain |
||
43 | // It avoids problems when one url is from another domain or is local |
||
44 | 10 | if (!$this->supports($sourceUrlFrom) || !$this->supports($sourceUrlTo)) { |
|
45 | 2 | return false; |
|
46 | } |
||
47 | |||
48 | 8 | $sourceUrlFrom = $this->generateBaseUrl($sourceUrlFrom); |
|
49 | 8 | $sourceUrlTo = $this->generateBaseUrl($sourceUrlTo); |
|
50 | |||
51 | 8 | if ($sourceUrlFrom !== $sourceUrlTo) { |
|
52 | // Comparison across forks is not supported |
||
53 | 2 | return false; |
|
54 | } |
||
55 | |||
56 | 6 | return sprintf( |
|
57 | 6 | '%s/compare/%s...%s', |
|
58 | 6 | $sourceUrlTo, |
|
59 | 6 | $this->getCompareVersion($versionFrom), |
|
60 | 6 | $this->getCompareVersion($versionTo) |
|
61 | 6 | ); |
|
62 | } |
||
63 | |||
80 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.