QueryString   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
1
<?php
2
/**
3
 * Copyright (c) 2010–2019 Ryan Parman <http://ryanparman.com>.
4
 * Copyright (c) 2016–2019 Contributors.
5
 *
6
 * http://opensource.org/licenses/Apache2.0
7
 */
8
9
declare(strict_types=1);
10
11
namespace SimplePie\UtilityPack\Util;
12
13
/**
14
 * A standardized builder for URI query strings.
15
 *
16
 * @see <https://tools.ietf.org/html/rfc1738>
17
 */
18
class QueryString
19
{
20
    /**
21
     * Build a query string from a given set of key-value pairs.
22
     *
23
     * @param string[] $qsa A set of key-value pairs to convert into a query string.
24
     *
25
     * @return string A query string.
26
     */
27 1
    public static function build(array $qsa): string
28
    {
29 1
        return \http_build_query($qsa, '', '&', \PHP_QUERY_RFC1738);
30
    }
31
}
32