@param Url                 $url
@param ResolutionInterface $resolution
@param ResolutionInterface $originalResolution

@return ResolutionInterface
777307
public function filter(Url $url, ResolutionInterface $resolution, ResolutionInterface $originalResolution)
    {
        if ($resolution->getResolutionType() === ResolutionType::POST) {
            $post = $resolution->getNode();

            if ($post instanceof Post and !$post instanceof AbstractPost) {
                /** @var File $attachment */
                foreach ($post->getAttachments(true) as $attachment) {
                    if (in_array($attachment->getExtension(), $this->extensions)) {
                        $post->mergeProperties($this->postFileParser->parse($attachment->getPath()));
                        $post->setProperty('__content_filename', $attachment->getUrl()->getLastSegment());

                        break;
                    }
                }
            }
        }

        return $resolution;
    }
1365364
public function setResolution(\BlackForest\PiwikBundle\Entity\PiwikResolution $resolution = null)
    {
        $this->resolution = $resolution;

        return $this;
    }
371049
private static function resolveUrl(array $url, ?array $base, array $queryDefaults = []): array
    {
        if (null !== $base && '' === ($base['scheme'] ?? '').($base['authority'] ?? '')) {
            throw new InvalidArgumentException(sprintf('Invalid "base_uri" option: host or scheme is missing in "%s".', implode('', $base)));
        }

        if (null === $base && '' === $url['scheme'].$url['authority']) {
            throw new InvalidArgumentException(sprintf('Invalid URL: no "base_uri" option was provided and host or scheme is missing in "%s".', implode('', $url)));
        }

        if (null !== $url['scheme']) {
            $url['path'] = self::removeDotSegments($url['path'] ?? '');
        } else {
            if (null !== $url['authority']) {
                $url['path'] = self::removeDotSegments($url['path'] ?? '');
            } else {
                if (null === $url['path']) {
                    $url['path'] = $base['path'];
                    $url['query'] = $url['query'] ?? $base['query'];
                } else {
                    if ('/' !== $url['path'][0]) {
                        if (null === $base['path']) {
                            $url['path'] = '/'.$url['path'];
                        } else {
                            $segments = explode('/', $base['path']);
                            array_splice($segments, -1, 1, [$url['path']]);
                            $url['path'] = implode('/', $segments);
                        }
                    }

                    $url['path'] = self::removeDotSegments($url['path']);
                }

                $url['authority'] = $base['authority'];

                if ($queryDefaults) {
                    $url['query'] = '?'.self::mergeQueryString(substr($url['query'] ?? '', 1), $queryDefaults, false);
                }
            }

            $url['scheme'] = $base['scheme'];
        }

        if ('' === ($url['path'] ?? '')) {
            $url['path'] = '/';
        }

        return $url;
    }
517274
protected function resolution(UriInterface $referenceUri)
    {
        $key = $referenceUri->toString();
        if (array_key_exists($key, $this->resolutions)) {
            return $this->resolutions[$key];
        }

        return null;
    }
1038176
public Object resolveRemote(String type, String url)
        throws IOException
    {
        HessianRemoteResolver resolver = getRemoteResolver();

        if (resolver != null)
            return resolver.lookup(type, url);
        else
            return new HessianRemote(type, url);
    }
950770
public function generateImage($originalUrl, array $attributesFilters)
    {
        if (empty($attributesFilters)) {
            throw new \InvalidArgumentException('Please provide at least one key for attribute generation (e.g. \'src\') ');
        }

        $image = (new \DOMDocument())->createElement('img');

        try {
            foreach ($attributesFilters as $attributeName => $filters) {
                $attributeValue = $this->attributeGenerator->generateAttributeValue($originalUrl, $filters);
                if ('' !== $attributeValue) {
                    $image->setAttribute($attributeName, $attributeValue);
                }
            }
        } catch (ResolutionException $e) {
            $image->setAttribute('src', $originalUrl);
        }

        return $this->renderer->render($image);
    }
259650
public static URIResolver createSAXURIResolver(Resolver resolver) {
    final SAXResolver saxResolver = new SAXResolver(resolver);
    return new URIResolver() {
      public Source resolve(String href, String base) throws TransformerException {
        try {
          return saxResolver.resolve(href, base);
        }
        catch (SAXException e) {
          throw toTransformerException(e);
        }
        catch (IOException e) {
          throw new TransformerException(e);
        }
      }
    };
  }
1083526
public static function resolveUrl(AssetInterface $asset, $url)
    {
        // given URL is absolute URL
        if (false !== strpos($url, '://')) {
            return $url;
        }

        // source directory of the asset
        $root = dirname($asset->getSourceRoot().'/'.$asset->getTargetPath());

        // path directory where asset is being copied
        $path = dirname($asset->getTargetPath());

        if ('.' === $path) {
            $image = $url;
        } else {
            $image = $path.'/'.$url;
        }

        if (null !== $root) {
            $image = $root.'/'.$url;
        }

        // cleanup local URLs
        if (false === strpos($image, '://')) {
            $image = self::removeQueryString($image);
            $image = self::removeAnchor($image);

            return self::resolveUps($image);
        }

        return $image;
    }
283045
public function resolve(Document $document, Uri $ref, $name, $depth, PropertyInterface $property = null)
    {
        $uri = $this->resolver->resolve($document->getBaseUri(), $ref);

        if (isset($this->objects[$uri->toString()])) {
            return $this->objects[$uri->toString()];
        }

        if ($property === null) {
            $property = new PropertyType();
            $property->setRef($uri->toString());
        }

        $this->objects[$uri->toString()] = $property;

        $doc  = $this->getDocument($uri, $document);
        $doc->getProperty($uri->getFragment(), $name, $depth, $property);

        return $property;
    }
969296
public function resolveAssetUri(string $uri): ?string
    {
        $targetObject = $this->convertUriToObject($uri);
        if ($targetObject === null) {
            $this->systemLogger->info(sprintf('Could not resolve "%s" to an existing asset; The asset was probably deleted.', $uri), LogEnvironment::fromMethodName(__METHOD__));
            return null;
        }
        return $this->resourceManager->getPublicPersistentResourceUri($targetObject->getResource());
    }
1357452
function resolveResolution (
  ref,
  resolver,
  bootedServices
) {
  const refParts = ref.split(':')
  return resolver(refParts, bootedServices)
}
1262459
public function getResultExtension(string $originalFileExtension = ''): string
    {
        if ($this->shouldKeepOriginalImageFormat()) {
            if (in_array($originalFileExtension, ['jpg', 'pjpg', 'png', 'gif'])) {
                return $originalFileExtension;
            }
        }

        if ($manipulationArgument = $this->manipulations->getManipulationArgument('format')) {
            return $manipulationArgument;
        }

        return $originalFileExtension;
    }
671220
private static function dnsResolve(array $url, NativeClientState $multi, array &$info, ?\Closure $onProgress): array
    {
        if ($port = parse_url($url['authority'], PHP_URL_PORT) ?: '') {
            $info['primary_port'] = $port;
            $port = ':'.$port;
        } else {
            $info['primary_port'] = 'http:' === $url['scheme'] ? 80 : 443;
        }

        $host = parse_url($url['authority'], PHP_URL_HOST);

        if (null === $ip = $multi->dnsCache[$host] ?? null) {
            $now = microtime(true);

            if (!$ip = gethostbynamel($host)) {
                throw new TransportException(sprintf('Could not resolve host "%s".', $host));
            }

            $info['namelookup_time'] += microtime(true) - $now;
            $multi->dnsCache[$host] = $ip = $ip[0];
        }

        $info['primary_ip'] = $ip;

        if ($onProgress) {
            // Notify DNS resolution
            $onProgress();
        }

        return [$host, $port, substr_replace($url['authority'], $ip, -\strlen($host) - \strlen($port), \strlen($host))];
    }
1223768
def resolving(self, ref: str):
        
        new_uri = urlparse.urljoin(self.resolution_scope, ref)
        uri, fragment = urlparse.urldefrag(new_uri)

        if normalize(uri) in self.store:
            schema = self.store[normalize(uri)]
        elif not uri or uri == self.base_uri:
            schema = self.schema
        else:
            schema = resolve_remote(uri, self.handlers)
            if self.cache:
                self.store[normalize(uri)] = schema

        old_base_uri, old_schema = self.base_uri, self.schema
        self.base_uri, self.schema = uri, schema
        try:
            with self.in_scope(uri):
                yield resolve_path(schema, fragment)
        finally:
            self.base_uri, self.schema = old_base_uri, old_schema
1201169
public function resolve($url)
    {
        $parts = parse_url($url);
        $parameters = [];
        $parameters['transport'] = isset($parts['scheme']) ? $parts['scheme'] : null;
        $parameters['encryption'] = null;

        // check for schemes such as 'ssl+smtp' and 'smtp+tls'
        if (strpos($parameters['transport'], '+') !== false) {
            $transports = explode('+', $parameters['transport']);
            if (count($transports) !== 2) {
                throw new \LogicException("Invalid transport in mailer url '$url'.");
            }

            if (in_array($transports[0], self::$valid_schemes)) {
                $parameters['transport'] = $transports[0];
                $parameters['encryption'] = $transports[1];
            } else {
                $parameters['transport'] = $transports[1];
                $parameters['encryption'] = $transports[0];
            }
        }

        $parameters['auth_mode'] = null;
        if (isset($parts['query'])) {
            parse_str($parts['query'], $query);

            // don't overwrite transport
            if (isset($query['transport'])) {
                unset($query['transport']);
            }

            // don't overwrite encryption if set
            if (isset($query['encryption']) && $parameters['encryption'] !== null) {
                unset($query['encryption']);
            }
            $parameters = array_merge($parameters, $query);
        }

        // extra parameters
        $parameters['host'] = isset($parts['host']) ? $parts['host'] : null;
        $parameters['port'] = isset($parts['port']) ? $parts['port'] : false;
        $parameters['user'] = isset($parts['user']) ? $parts['user'] : null;
        $parameters['password'] = isset($parts['pass']) ? $parts['pass'] : null;

        // some validation
        if ($parameters['transport'] !== null && !in_array($parameters['transport'], self::$valid_schemes)) {
            throw new \LogicException("Invalid transport scheme '{$parameters['transport']}'.");
        }

        if ($parameters['encryption'] !== null && !in_array($parameters['encryption'], self::$valid_encryption)) {
            throw new \LogicException("Invalid encryption method '{$parameters['encryption']}'.");
        }

        if ($parameters['auth_mode'] !== null && !in_array($parameters['auth_mode'], self::$valid_auth_modes)) {
            throw new \LogicException("Invalid auth_mode '{$parameters['auth_mode']}'.");
        }

        // some extra checks for specific cases
        if ($parameters['transport'] === null) {
            if ($url === 'sendmail://' || $url === 'sendmail') {
                $parameters['transport'] = 'sendmail';
            } else if ($url === 'mail://' || $url === 'mail') {
                $parameters['transport'] = 'mail';
            } else if (strpos($url, 'gmail://') === 0) {
                $userpass = substr($url, 8);
                $userpassparts = explode(':', $userpass, 2);
                if (count($userpassparts) === 2) {
                    $parameters['transport'] = 'gmail';
                    $parameters['user'] = $userpassparts[0];
                    $parameters['password'] = $userpassparts[1];
                }
            } else {
                throw new \LogicException("Invalid url specified '{$url}'");
            }
        }

        // disable transport if requested
        if ($parameters['transport'] === 'none' || $parameters['transport'] === 'null') {
            $parameters['transport'] = null;
        }

        return $parameters;
    }
1027303
public function getMaxResolution( $default = null ) {

		$prop = $this->properties[ self::PROP_MAX_RESOLUTION ];

		if( isset( $prop ) && strlen( $prop ) > 0 ) {

			return $prop;
		}

		return $default;
	}
1212676
public function resolve(string $service): ResolveAllUrlsResponse
    {
        $key = $this->cacheKey($service);
        $item = $this->cache->getItem($key);

        if ($item->isHit()) {
            return $item->get();
        }

        $options = [
            'query' => [
                'schema' => self::SCHEMA_VERSION,
                '_service' => $service,
            ],
        ];

        $response = $this->authenticatedClient->request('GET', static::RESOLVE_ALL_URLS_URL, $options);

        $encoders = [new JsonEncoder()];
        $normalizers = [new UriNormalizer(), new ObjectNormalizer(null, null, null, new PhpDocExtractor()), new ArrayDenormalizer()];
        $serializer = new Serializer($normalizers, $encoders);

        /** @var ResolveAllUrlsResponse $resolved */
        $resolved = $serializer->deserialize($response->getBody(), ResolveAllUrlsResponse::class, 'json');
        $resolved->setService($service);
        $this->saveCache($key, $resolved);

        return $resolved;
    }