[REF] Update fetchAll function signature to match parent function
[civicrm-core.git] / CRM / Utils / Url.php
CommitLineData
f9bdf062 1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
f9bdf062 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
f9bdf062 9 +--------------------------------------------------------------------+
10 */
11
12use GuzzleHttp\Psr7\Uri;
13use Psr\Http\Message\UriInterface;
14
15class CRM_Utils_Url {
16
17 /**
18 * Parse url to a UriInterface.
19 *
20 * @param string $url
21 *
6714d8d2 22 * @return \GuzzleHttp\Psr7\UriInterface
f9bdf062 23 */
24 public static function parseUrl($url) {
25 return new Uri($url);
26 }
27
28 /**
29 * Unparse url back to a string.
30 *
6714d8d2 31 * @param \GuzzleHttp\Psr7\UriInterface $parsed
f9bdf062 32 *
33 * @return string
34 */
35 public static function unparseUrl(UriInterface $parsed) {
36 return $parsed->__toString();
37 }
38
39}