GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

QueryStr::parse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 2
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Nathanmac\Utilities\Parser\Formats;
4
5
/**
6
 * Query String Formatter
7
 *
8
 * @package    Nathanmac\Utilities\Parser\Formats
9
 * @author     Nathan Macnamara <[email protected]>
10
 * @license    https://github.com/nathanmac/Parser/blob/master/LICENSE.md  MIT
11
 */
12
class QueryStr implements FormatInterface
13
{
14
    /**
15
     * Parse Payload Data
16
     *
17
     * @param string $payload
18
     *
19
     * @return array
20
     */
21 9
    public function parse($payload)
22
    {
23 9
        if ($payload) {
24 6
            parse_str(trim($payload), $querystr);
25 6
            return $querystr;
26
        }
27
28 3
        return [];
29
    }
30
}
31