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.

Response   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A response() 0 6 1
A makeResponse() 0 8 1
A send() 0 9 2
A setRequest() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Good One Sales
5
 * Date: 9/3/2018
6
 * Time: 12:26 PM
7
 */
8
9
namespace Goodoneuz\PayUz\Http\Classes\Paynet;
10
11
use Carbon\Carbon;
12
use App\Transaction;
13
use Goodoneuz\PayUz\Http\Classes\PaymentException;
14
15
class Response
16
{
17
    const ERROR_INTERNAL_SYSTEM         = -32400;
18
    const ERROR_INSUFFICIENT_PRIVILEGE  = -32504;
19
    const ERROR_INVALID_JSON_RPC_OBJECT = -32600;
20
    const ERROR_METHOD_NOT_FOUND        = -32601;
21
    const ERROR_INVALID_AMOUNT          = -31001;
22
    const ERROR_TRANSACTION_NOT_FOUND   = -31003;
23
    const ERROR_INVALID_ACCOUNT         = -31050;
24
    const ERROR_COULD_NOT_CANCEL        = -31007;
25
    const ERROR_COULD_NOT_PERFORM       = -31008;
26
    const SUCCESS                       = 0;
27
28
    public $request;
29
    public $body;
30
    public $code;
31
32
    public function response($request, $body, $code){
33
        $this->request = $request;
34
        $this->body  = $body;
35
        $this->code = $code;
36
        throw new PaymentException($this);
37
    }
38
    public static function makeResponse($body){
39
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>".
40
                    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">".
41
                    "<soapenv:Body>".
42
                        $body.
43
                    "</soapenv:Body>".
44
                "</soapenv:Envelope>";
45
    }
46
    public function send(){
47
        header('content-type: text/xml;');
48
        if ($this->request == null)
49
            echo 'error';
50
        else 
51
            echo $this->body;
52
        
53
        exit();
54
    }
55
56
    public function setRequest($request){
57
        return $this->request = $request;
58
    }
59
}
60