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.

UriPath::getRegexpes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @author Bram Gerritsen [email protected]
4
 * @copyright (c) Bram Gerritsen 2013
5
 * @license http://opensource.org/licenses/mit-license.php
6
 */
7
8
namespace StrokerCache\Strategy;
9
10
use Zend\Http\Request as HttpRequest;
11
use Zend\Mvc\MvcEvent;
12
13
class UriPath extends AbstractStrategy
14
{
15
    /**
16
     * @var array
17
     */
18
    protected $regexpes = [];
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function shouldCache(MvcEvent $event)
24
    {
25
        $request = $event->getRequest();
26
        if (!$request instanceof HttpRequest) {
27
            return false;
28
        }
29
30
        $uri = $request->getUri();
31
        foreach ($this->getRegexpes() as $regex) {
32
            if (preg_match($regex, $uri->getPath())) {
33
                return true;
34
            }
35
        }
36
37
        return false;
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    public function getRegexpes()
44
    {
45
        return $this->regexpes;
46
    }
47
48
    /**
49
     * @param array $regexpes
50
     */
51
    public function setRegexpes(array $regexpes)
52
    {
53
        $this->regexpes = $regexpes;
54
    }
55
}
56