Skip to content

Commit 0d041c3

Browse files
bburnichonBenoît Burnichon
authored andcommitted
ChooseBaseUrl should return an index
Enforce chooseBaseUrl to return an integer index to the baseUrls member.
1 parent 07673dc commit 0d041c3

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)