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.

RequestTargetNotMatched   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 42
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A generateMessage() 0 3 1
A getFailedRequestTarget() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Meraki\Route\Exception;
5
6
use RuntimeException;
7
use Meraki\Route\Exception as RouteException;
8
9
/**
10
 * Exception used when the pattern of a route could not be matched against the request-target.
11
 *
12
 * @author Nathan Bishop <[email protected]> (https://nathanbishop.name)
13
 * @copyright 2019 Nathan Bishop
14
 * @license The MIT license.
15
 */
16
final class RequestTargetNotMatched extends RuntimeException implements RouteException
17
{
18
    /**
19
     *
20
     */
21
    public const EQUIVALENT_STATUS_CODE = 404;
22
23
    /**
24
     * @var string [$failedRequestTarget description]
25
     */
26
    private $failedRequestTarget;
27
28
    /**
29
     * [__construct description]
30
     *
31
     * @param string $failedRequestTarget [description]
32
     */
33
    public function __construct(string $failedRequestTarget)
34
    {
35
        $this->failedRequestTarget = $failedRequestTarget;
36
37
        parent::__construct($this->generateMessage(), self::EQUIVALENT_STATUS_CODE);
38
    }
39
40
    /**
41
     * [getFailedRequestTarget description]
42
     *
43
     * @return string [description]
44
     */
45
    public function getFailedRequestTarget(): string
46
    {
47
        return $this->failedRequestTarget;
48
    }
49
50
    /**
51
     * [generateMessage description]
52
     *
53
     * @return string [description]
54
     */
55
    private function generateMessage(): string
56
    {
57
    	return sprintf('The request target "%s" could not be matched!', $this->failedRequestTarget);
58
    }
59
}
60