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 ( ec20ca...974108 )
by Olivier
02:15
created

helpers.php ➔ get_initial_request()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 5
c 2
b 0
f 1
nc 2
nop 0
dl 0
loc 11
rs 9.4285
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
/**
15
 * Dispatches a request.
16
 *
17
 * The request is dispatched by the dispatcher returned by the {@link get_dispatcher()} function.
18
 *
19
 * @param Request $request
20
 *
21
 * @return Response
22
 */
23
function dispatch(Request $request)
24
{
25
	$dispatcher = get_dispatcher();
26
27
	return $dispatcher($request);
28
}
29
30
/**
31
 * Returns a shared request dispatcher.
32
 *
33
 * @return Dispatcher
34
 */
35
function get_dispatcher()
36
{
37
	if (!DispatcherProvider::defined())
38
	{
39
		DispatcherProvider::define(new ProvideDispatcher);
40
	}
41
42
	return DispatcherProvider::provide();
43
}
44
45
/**
46
 * Returns the initial request.
47
 *
48
 * The initial request is created once from the `$_SERVER` array.
49
 *
50
 * @return Request
51
 */
52
function get_initial_request()
53
{
54
	static $initial_request;
55
56
	if (!$initial_request)
57
	{
58
		$initial_request = Request::from($_SERVER);
59
	}
60
61
	return $initial_request;
62
}
63