Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResponseHeaderLocationSame.php

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

ResponseHeaderLocationSame

Namespace

Symfony\Component\HttpFoundation\Test\Constraint

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal