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.

OsonException   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 52
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 18 9
A send() 0 12 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Shaxzodbek
5
 * Date: 25.05.2018
6
 * Time: 9:57
7
 */
8
9
namespace App\Http\Classes\Oson;
10
11
12
use Illuminate\Support\Facades\Log;
13
14
class OsonException extends \Exception
15
{
16
    const SUCCESS                       = 0;
17
    const ERROR_AUTHORIZATION           = 1;
18
    const ERROR_INVALID_AMOUNT          = 2;
19
    const ERROR_ALREADY_PAID            = 3;
20
    const ERROR_TRANSACTION_NOT_FOUND   = 4;
21
    const ERROR_ORDER_NOT_FOUND         = 5;
22
    const ERROR_INTERNAL_SYSTEM         = 10;
23
    const ERROR_UNKNOWN                 = 11;
24
    const ERROR_ORDER_NOT_AVAILABLE     = 12;
25
26
    public $result;
27
    public $status;
28
29
    /**
30
     * PaycomException constructor.
31
     * @param $status
32
     * @param $params ['providerTrnId','ts'] [exist]
33
     */
34
    public function __construct($status,$params)
35
    {
36
37
        $this->result = $params;
38
        $this->result['status'] = $status;
39
        switch ($status){
40
            case 0: $this->message='Нет ошибок'; break;
41
            case 1: $this->message = 'Ошибка авторизации'; break;
42
            case 2: $this->message = 'Неверный параметр'; break;
43
            case 3: $this->message = 'Транзакция уже существует'; break;
44
            case 4: $this->message = 'Транзакция уже отменена'; break;
45
            case 5: $this->message = 'Клиент не найден'; break;
46
            case 10: $this->message = 'Системная ошибка'; break;
47
            case 11: $this->message = 'Неизвестная ошибка'; break;
48
            default: $this->status = 12;
49
                $this->message = 'Услуга временно не поддерживается'; break;
50
        }
51
    }
52
53
    public function send()
54
    {
55
        header('Content-Type: application/json; charset=UTF-8');
56
        // create response
57
        $response = array();
58
        $response[]  = [
59
            'jsonrcp'=> '2.0',
60
            'result' => $this->result
61
        ];
62
        echo json_encode($response);
63
        exit();
64
    }
65
}
66