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 — master ( 58ff8d...1de4e3 )
by Olivier
01:28
created

ForceRedirect::format_message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ICanBoogie\HTTP;
13
14
use ICanBoogie\Accessor\AccessorTrait;
15
16
/**
17
 * Exception thrown to force the redirect of the response.
18
 *
19
 * @property-read string $location The location of the redirect.
20
 */
21 View Code Duplication
class ForceRedirect extends \Exception implements Exception
22
{
23
	use AccessorTrait;
24
25
	private $location;
26
27
	protected function get_location()
28
	{
29
		return $this->location;
30
	}
31
32
	public function __construct($location, $code = Status::FOUND, \Exception $previous = null)
33
	{
34
		$this->location = $location;
35
36
		parent::__construct($this->format_message($location), $code, $previous);
37
	}
38
39
	/**
40
	 * Formats exception message.
41
	 *
42
	 * @param string $location
43
	 *
44
	 * @return string
45
	 */
46
	protected function format_message($location)
47
	{
48
		return \ICanBoogie\format("Location: %location", [ 'location' => $location ]);
49
	}
50
}
51