Completed
Pull Request — master (#1275)
by
unknown
03:05
created

Guard   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldReturnRawResponse() 0 3 1
A validate() 0 3 1
A isSafeMode() 0 3 1
1
<?php
2
/**
3
 * @link https://www.chaoyouyun.com
4
 * @copyright 2014-2018 Chongqing Xianzhou Technology LLC
5
 *
6
 * @author Xiaomin<[email protected]>
7
 * @version 1.0.0
8
 * @since 1.0
9
 */
10
11
namespace EasyWeChat\OpenWork\Server;
12
13
14
use EasyWeChat\Kernel\ServerGuard;
15
16
class Guard extends ServerGuard
17
{
18
    protected $alwaysValidate = true;
19
20
    /**
21
     * @return bool
22
     */
23
    public function validate()
24
    {
25
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type EasyWeChat\OpenWork\Server\Guard which is incompatible with the documented return type boolean.
Loading history...
26
    }
27
28
    /**
29
     * @return bool
30
     */
31
    protected function shouldReturnRawResponse(): bool
32
    {
33
        return !is_null($this->app['request']->get('echostr'));
34
    }
35
36
    protected function isSafeMode(): bool
37
    {
38
        return true;
39
    }
40
}
41