Test Failed
Push — master ( e9376b...ed8bc2 )
by wannanbigpig
04:20 queued 01:49
created

Application   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 64
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setMethod() 0 5 1
A __construct() 0 3 1
A verify() 0 3 1
A __call() 0 3 1
1
<?php
2
/**
3
 * Application.php
4
 *
5
 * Created by PhpStorm.
6
 *
7
 * author: liuml  <[email protected]>
8
 * DateTime: 2019-04-04  16:31
9
 */
10
11
namespace WannanBigPig\Alipay\Notify;
12
13
use WannanBigPig\Alipay\Kernel\Support\Support;
14
use WannanBigPig\Supports\Exceptions;
15
16
class Application
17
{
18
19
    use Notify;
20
21
    /**
22
     * @var string
23
     */
24
    const SUCCESS = 'success';
25
26
    /**
27
     * @var string
28
     */
29
    const FAIL = 'fail';
30
31
    /**
32
     * @var string
33
     */
34
    protected $method = '';
35 1
36
    /**
37 1
     * Application constructor.
38 1
     */
39
    public function __construct()
40
    {
41
        $this->setMethod();
42
    }
43 1
44
    /**
45 1
     * __call
46 1
     *
47 1
     * @param $name
48
     * @param $arguments
49 1
     *
50
     * @return mixed
51
     */
52
    public function __call($name, $arguments)
53
    {
54
        return call_user_func([$this, $name], ...$arguments);
55
    }
56
57
    /**
58
     * setMethod
59
     */
60
    protected function setMethod()
61
    {
62
        Support::$config->set('event', [
63
            'driver' => 'Notify',
64
            'method' => $this->method,
65
        ]);
66
    }
67
68
    /**
69
     * verify
70
     *
71
     * @param  mixed  $data
72
     *
73
     * @return bool
74
     *
75
     * @throws Exceptions\InvalidArgumentException
76
     */
77
    public function verify($data = null)
78
    {
79
        return Support::notifyVerify($data);
80
    }
81
}
82