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 ( 8bf793...f49fde )
by Shaxzodbek
01:23
created

WoywoException::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Shaxzodbek
5
 * Date: 24.05.2018
6
 * Time: 15:37
7
 */
8
9
namespace App\Http\Classes\Woywo;
10
11
12
class WoywoException extends \Exception
13
{
14
    const SUCCESS                       = 0;
15
    const ERROR_INSUFFICIENT_PRIVILEGE  = -1;
16
    const ERROR_INVALID_AMOUNT          = -2;
17
    const ERROR_ALREADY_PAID            = -3;
18
    const ERROR_TRANSACTION_NOT_FOUND   = -4;
19
    const ERROR_INTERNAL_SYSTEM         = -5;
20
    const ERROR_UNKNOWN                 = -6;
21
    const ERROR_INVALID_JSON_RPC_OBJECT = -7;
22
    const ERROR_METHOD_NOT_FOUND        = -8;
23
    const ERROR_ORDER_NOT_FOUND         = -9;
24
    const ERROR_ORDER_NOT_AVAILABLE     = -10;
25
26
    public $message;
27
    public $status;
28
29
    /**
30
     * PaycomException constructor.
31
     * @param $status
32
     */
33
    public function __construct($status)
34
    {
35
        $this->status = $status;
36
37
        switch ($status){
38
            case 0: $this->message='Success'; break;
39
            case -1: $this->message = 'Sign check failed'; break;
40
            case -2: $this->message = 'Incorrect parameter amount'; break;
41
            case -3: $this->message = 'Transaction already paid'; break;
42
            case -4: $this->message = 'Transaction does not exist'; break;
43
            case -5: $this->message = 'System Error'; break;
44
            default:
45
                    $this->message = 'Unknown Error'; break;
46
        }
47
    }
48
49
    public function send()
50
    {
51
        header('Content-Type: application/json; charset=UTF-8');
52
        // create response
53
        $response = array();
54
        $response['status']  = $this->status;
55
        $response['message'] = $this->message;
56
        echo json_encode($response);
57
        exit();
58
    }
59
60
}
61