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.
Passed
Push — master ( b027da...71edf5 )
by Yong
09:39
created

Filter   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 53
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 7

2 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 17 3
A value() 0 17 4
1
<?php
2
3
namespace AlibabaCloud\Client\Filter;
4
5
use AlibabaCloud\Client\Exception\ClientException;
6
7
/**
8
 * Class Filter
9
 *
10
 * @package AlibabaCloud\Client\Filter
11
 */
12
class Filter
13
{
14
15
    /**
16
     * @param $name
17
     *
18
     * @return string
19
     *
20
     * @throws ClientException
21
     */
22 168
    public static function name($name)
23
    {
24 168
        if (!is_string($name)) {
25 5
            throw new ClientException(
26 5
                'Name must be a string',
27
                \ALIBABA_CLOUD_INVALID_ARGUMENT
28 5
            );
29
        }
30
31 163
        if ($name === '') {
32 5
            throw new ClientException(
33 5
                'Name cannot be empty',
34
                \ALIBABA_CLOUD_INVALID_ARGUMENT
35 5
            );
36
        }
37
38 158
        return $name;
39
    }
40
41
    /**
42
     * @param $value
43
     *
44
     * @return string
45
     *
46
     * @throws ClientException
47
     */
48 12
    public static function value($value)
49
    {
50 12
        if (!is_numeric($value) && !is_string($value)) {
51 3
            throw new ClientException(
52 3
                'Value must be a string or int',
53
                \ALIBABA_CLOUD_INVALID_ARGUMENT
54 3
            );
55
        }
56
57 9
        if ($value === '') {
58 3
            throw new ClientException(
59 3
                'Value cannot be empty',
60
                \ALIBABA_CLOUD_INVALID_ARGUMENT
61 3
            );
62
        }
63
64 6
        return $value;
65
    }
66
}
67