NotifyProcessing::UnAuthorized()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace OpenOauth;
4
5
use OpenOauth\Core\Core;
6
7
class NotifyProcessing extends Core
8
{
9
    /**
10
     * componentVerifyTicket
11
     *
12
     * @param $xml_array
13
     *
14
     * @return mixed
15
     */
16
    public function componentVerifyTicket($xml_array)
17
    {
18
        $key = 'component_verify_ticket:' . $xml_array['AppId'];
19
        self::$cacheDriver->_set($key, $xml_array['ComponentVerifyTicket'], 0);
20
        $component_verify_ticket = $xml_array['ComponentVerifyTicket'];
21
22
        return $component_verify_ticket;
23
    }
24
25
    /**
26
     * Authorized
27
     *
28
     * @param $xml_array
29
     *
30
     * @return mixed
31
     */
32 View Code Duplication
    public function Authorized($xml_array)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
    {
34
        $key = 'authorized:' . $xml_array['AppId'] . ':' . $xml_array['AuthorizerAppid'];
35
        self::$databaseDriver->_set($key, $xml_array);
36
37
        return $xml_array;
38
    }
39
40
    /**
41
     * UpdateAuthorized
42
     *
43
     * @param $xml_array
44
     *
45
     * @return mixed
46
     */
47 View Code Duplication
    public function UpdateAuthorized($xml_array)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
48
    {
49
        $key = 'authorized:' . $xml_array['AppId'] . ':' . $xml_array['AuthorizerAppid'];
50
        self::$databaseDriver->_set($key, $xml_array);
51
52
        return $xml_array;
53
    }
54
55
    /**
56
     * @param $xml_array
57
     *
58
     * @return mixed
59
     */
60
    public function UnAuthorized($xml_array)
61
    {
62
        $key = 'query_auth:' . $this->configs->component_app_id . ':' . $xml_array['AuthorizerAppid'];
63
64
        $query_auth_info = self::$databaseDriver->_get($key);
65
66
        if (!empty($query_auth_info)) {
67
            $query_auth_info['authorization_state'] = 'unauthorized';
68
69
            self::$databaseDriver->_set($key, $query_auth_info);
70
        }
71
72
        return $xml_array;
73
    }
74
}