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.
Test Setup Failed
Pull Request — master (#162)
by Yong
03:00
created

Path::assign()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlibabaCloud\Client\Support;
4
5
/**
6
 * Class Path
7
 *
8
 * @package AlibabaCloud\Client\Support
9
 */
10
class Path
11
{
12
    /**
13
     * Assign path parameters to the url.
14
     *
15
     * @param string $pattern
16
     * @param array  $parameters
17
     *
18
     * @return string
19
     */
20
    public static function assign($pattern, array $parameters)
21
    {
22
        foreach ($parameters as $key => $value) {
23
            $pattern = str_replace("[$key]", $value, $pattern);
24
        }
25
26
        return $pattern;
27
    }
28
}
29