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 ( 6d880e...6fcb7a )
by t
05:21 queued 03:08
created

Unicode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 24
ccs 0
cts 7
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A decode() 0 3 1
A encode() 0 3 1
1
<?php
2
/**
3
 * Class Unicode
4
 * @link https://www.icy2003.com/
5
 * @author icy2003 <[email protected]>
6
 * @copyright Copyright (c) 2017, icy2003
7
 */
8
namespace icy2003\php\ihelpers;
9
10
/**
11
 * Unicode 编码/解码
12
 */
13
class Unicode
14
{
15
    /**
16
     * Unicode 编码
17
     *
18
     * @param string $string
19
     *
20
     * @return string
21
     */
22
    public static function encode($string)
23
    {
24
        return trim(json_encode($string), '"');
25
    }
26
27
    /**
28
     * Unicode 解码
29
     *
30
     * @param string $string
31
     *
32
     * @return string
33
     */
34
    public static function decode($string)
35
    {
36
        return implode('', Json::decode('["' . $string . '"]'));
37
    }
38
}
39