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.
Completed
Push — master ( 24ae15...d40ff0 )
by t
05:40 queued 03:33
created

C::assertExtension()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
rs 10
1
<?php
2
/**
3
 * Class C
4
 *
5
 * @link https://www.icy2003.com/
6
 * @author icy2003 <[email protected]>
7
 * @copyright Copyright (c) 2017, icy2003
8
 */
9
namespace icy2003\php;
10
11
use Exception;
12
13
/**
14
 * 配置(Config)、检查(Check)、常量(Constant)
15
 */
16
class C
17
{
18
    /**
19
     * 断言扩展,未加载则抛错
20
     *
21
     * @param string $extension 扩展名
22
     * @param string $message
23
     *
24
     * @return void
25
     */
26 15
    public static function assertExtension($extension, $message)
27
    {
28 15
        if (false === extension_loaded($extension)) {
29 1
            throw new Exception($message);
30
        }
31 14
    }
32
33
    /**
34
     * 断言函数,不存在则抛错
35
     *
36
     * @param string $function
37
     * @param string $message
38
     *
39
     * @return void
40
     */
41 1
    public static function assertFunction($function, $message)
42
    {
43 1
        if (false === function_exists($function)) {
44 1
            throw new Exception($message);
45
        }
46 1
    }
47
48
    /**
49
     * 断言真,不为真则抛错
50
     *
51
     * @param boolean $isTrue
52
     * @param string $message
53
     *
54
     * @return void
55
     */
56 8
    public static function assertTrue($isTrue, $message)
57
    {
58 8
        if (true !== $isTrue) {
59 3
            throw new Exception($message);
60
        }
61 8
    }
62
63
    /**
64
     * 断言非真,为真则抛错
65
     *
66
     * @param boolean $isTrue
67
     * @param string $message
68
     *
69
     * @return void
70
     */
71 8
    public static function assertNotTrue($isNotTrue, $message)
72
    {
73 8
        if (true === $isNotTrue) {
74 2
            throw new Exception($message);
75
        }
76 8
    }
77
78
    /**
79
     * 断言假,不为假则抛错
80
     *
81
     * @param boolean $isTrue
82
     * @param string $message
83
     *
84
     * @return void
85
     */
86 2
    public static function assertFalse($isFalse, $message)
87
    {
88 2
        if (false !== $isFalse) {
89 2
            throw new Exception($message);
90
        }
91 2
    }
92
93
    /**
94
     * 断言非假,为假则抛错
95
     *
96
     * @param boolean $isTrue
97
     * @param string $message
98
     *
99
     * @return void
100
     */
101 1
    public static function assertNotFalse($isNotFalse, $message)
102
    {
103 1
        if (false === $isNotFalse) {
104 1
            throw new Exception($message);
105
        }
106 1
    }
107
}
108