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   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 4
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldCache() 0 16 4
A getRegexpes() 0 4 1
A setRegexpes() 0 4 1
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