function ResponseHeaderLocationSame::toFullUrl
1 call to ResponseHeaderLocationSame::toFullUrl()
- ResponseHeaderLocationSame::matches in vendor/
symfony/ http-foundation/ Test/ Constraint/ ResponseHeaderLocationSame.php - Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.
File
-
vendor/
symfony/ http-foundation/ Test/ Constraint/ ResponseHeaderLocationSame.php, line 49
Class
Namespace
Symfony\Component\HttpFoundation\Test\ConstraintCode
private function toFullUrl(string $url) : string {
if (null === parse_url($url, \PHP_URL_PATH)) {
$url .= '/';
}
if (str_starts_with($url, '//')) {
return \sprintf('%s:%s', $this->request
->getScheme(), $url);
}
if (str_starts_with($url, '/')) {
return $this->request
->getSchemeAndHttpHost() . $url;
}
return $url;
}