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.
Completed
Push — 3.x ( 95c967...fcf84f )
by
unknown
21s queued 11s
created

Routable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
/**
3
 * Slim Framework (https://slimframework.com)
4
 *
5
 * @license https://github.com/slimphp/Slim/blob/3.x/LICENSE.md (MIT License)
6
 */
7
8
namespace Slim;
9
10
use Psr\Container\ContainerInterface;
11
12
abstract class Routable
13
{
14
    use CallableResolverAwareTrait;
15
16
    /**
17
     * Route callable
18
     *
19
     * @var callable
20
     */
21
    protected $callable;
22
23
    /**
24
     * Container
25
     *
26
     * @var ContainerInterface
27
     */
28
    protected $container;
29
30
    /**
31
     * Route middleware
32
     *
33
     * @var callable[]
34
     */
35
    protected $middleware = [];
36
37
    /**
38
     * Route pattern
39
     *
40
     * @var string
41
     */
42
    protected $pattern;
43
44
    /**
45
     * @param string   $pattern
46
     * @param callable $callable
47
     */
48
    public function __construct($pattern, $callable)
49
    {
50
        $this->pattern = $pattern;
51
        $this->callable = $callable;
52
    }
53
54
    /**
55
     * Get the middleware registered for the group
56
     *
57
     * @return callable[]
58
     */
59
    public function getMiddleware()
60
    {
61
        return $this->middleware;
62
    }
63
64
    /**
65
     * Get the route pattern
66
     *
67
     * @return string
68
     */
69
    public function getPattern()
70
    {
71
        return $this->pattern;
72
    }
73
74
    /**
75
     * Set container for use with resolveCallable
76
     *
77
     * @param ContainerInterface $container
78
     *
79
     * @return static
80
     */
81
    public function setContainer(ContainerInterface $container)
82
    {
83
        $this->container = $container;
84
        return $this;
85
    }
86
87
    /**
88
     * Prepend middleware to the middleware collection
89
     *
90
     * @param callable|string $callable The callback routine
91
     *
92
     * @return static
93
     */
94
    public function add($callable)
95
    {
96
        $this->middleware[] = new DeferredCallable($callable, $this->container);
97
        return $this;
98
    }
99
100
    /**
101
     * Set the route pattern
102
     *
103
     * @param string $newPattern
104
     */
105
    public function setPattern($newPattern)
106
    {
107
        $this->pattern = $newPattern;
108
    }
109
}
110