Skip to content

Commit 90ce9bc

Browse files
committed
minor symfony#17378 [Asset] ChooseBaseUrl should return an offset (bburnichon)
This PR was merged into the 2.7 branch. Discussion ---------- [Asset] ChooseBaseUrl should return an offset | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Enforce chooseBaseUrl to return an integer offset to the baseUrls member. Commits ------- 0d041c3 ChooseBaseUrl should return an index
2 parents 1974eaf + 0d041c3 commit 90ce9bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Asset/UrlPackage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ public function getBaseUrl($path)
108108
* Determines which base URL to use for the given path.
109109
*
110110
* Override this method to change the default distribution strategy.
111-
* This method should always return the same base URL for a given path.
111+
* This method should always return the same base URL index for a given path.
112112
*
113113
* @param string $path
114114
*
115-
* @return string The base URL for the given path
115+
* @return int The base URL index for the given path
116116
*/
117117
protected function chooseBaseUrl($path)
118118
{
119-
return fmod(hexdec(substr(hash('sha256', $path), 0, 10)), count($this->baseUrls));
119+
return (int) fmod(hexdec(substr(hash('sha256', $path), 0, 10)), count($this->baseUrls));
120120
}
121121

122122
private function getSslUrls($urls)

0 commit comments

Comments
 (0)