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 ( 2de795...ddc223 )
by Samuel
03:58
created

HTTPRequestFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 6 1
A get() 0 6 1
1
<?php declare(strict_types=1);
2
/**
3
 * @license MIT
4
 * @author Samuel Adeshina <[email protected]>
5
 *
6
 * This file is part of the EmmetBlue project, please read the license document
7
 * available in the root level of the project
8
 */
9
namespace EmmetBlue\Core\Factory;
10
11
use Requests;
12
13
/**
14
 * Class HTTPRequestFactory.
15
 *
16
 * @author Samuel Adeshina <[email protected]>
17
 *
18
 * @since v0.0.1 08/06/2016 14:20
19
 */
20
class HTTPRequestFactory
21
{
22
	private static $headers;
23
24
	public static function bootstrap()
25
	{
26
		$configJson = file_get_contents("bin/configs/http-headers-config.json");
27
28
        $this->headers = json_decode($configJson);
0 ignored issues
show
Bug introduced by
The variable $this does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
29
	}
30
31
	public static function get($url, $extraHeaders = [])
32
	{
33
		self::bootstrap();
34
		
35
		return Requests::get($url, array_merge($this->headers, $extraHeaders));
0 ignored issues
show
Bug introduced by
The variable $this does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
36
	}
37
}