mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #2174 from oovk/master
Fixed PSR issues in the URL library
This commit is contained in:
commit
93f74afce0
1 changed files with 18 additions and 18 deletions
|
|
@ -13,7 +13,7 @@ class URL
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function parse(string $url):array
|
public static function parse(string $url): array
|
||||||
{
|
{
|
||||||
$default = [
|
$default = [
|
||||||
'scheme' => '',
|
'scheme' => '',
|
||||||
|
|
@ -39,7 +39,7 @@ class URL
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function unparse(array $url, array $ommit = []):string
|
public static function unparse(array $url, array $ommit = []): string
|
||||||
{
|
{
|
||||||
if (isset($url['path']) && \mb_substr($url['path'], 0, 1) !== '/') {
|
if (isset($url['path']) && \mb_substr($url['path'], 0, 1) !== '/') {
|
||||||
$url['path'] = '/'.$url['path'];
|
$url['path'] = '/'.$url['path'];
|
||||||
|
|
@ -55,7 +55,7 @@ class URL
|
||||||
|
|
||||||
$parts['user'] = isset($url['user']) ? $url['user'] : '';
|
$parts['user'] = isset($url['user']) ? $url['user'] : '';
|
||||||
|
|
||||||
$parts['pass'] = isset($url['pass']) ? ':'.$url['pass'] : '';
|
$parts['pass'] = isset($url['pass']) ? ':'.$url['pass'] : '';
|
||||||
|
|
||||||
$parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'].'@' : '';
|
$parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'].'@' : '';
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ class URL
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function parseQuery(string $query):array
|
public static function parseQuery(string $query): array
|
||||||
{
|
{
|
||||||
\parse_str($query, $result);
|
\parse_str($query, $result);
|
||||||
|
|
||||||
|
|
@ -101,7 +101,7 @@ class URL
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function unparseQuery(array $query):string
|
public static function unparseQuery(array $query): string
|
||||||
{
|
{
|
||||||
return \http_build_query($query);
|
return \http_build_query($query);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue