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.

AbstractTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
c 5
b 0
f 0
lcom 0
cbo 4
dl 0
loc 42
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
A getQuery() 0 11 1
A getResponse() 0 10 1
1
<?php
2
3
namespace prgTW\BaseCRM\Tests;
4
5
use GuzzleHttp\Message\Response;
6
use GuzzleHttp\Stream\Stream;
7
use prgTW\BaseCRM\Transport\Transport;
8
9
abstract class AbstractTest extends \PHPUnit_Framework_TestCase
10
{
11
	/** {@inheritdoc} */
12
	public function tearDown()
13
	{
14
		\Mockery::close();
15
	}
16
17
	/**
18
	 * @param array $query
19
	 *
20
	 * @return array
21
	 */
22
	protected function getQuery(array $query = [])
23
	{
24
		$query = array_merge_recursive([
25
			'headers' => [
26
				Transport::TOKEN_PIPEJUMP_NAME     => '',
27
				Transport::TOKEN_FUTUERSIMPLE_NAME => '',
28
			],
29
		], $query);
30
31
		return $query;
32
	}
33
34
	/**
35
	 * @param int    $status
36
	 * @param string $body
37
	 *
38
	 * @return Response
39
	 */
40
	protected function getResponse($status, $body)
41
	{
42
		$stream = fopen('php://temp', 'r+');
43
		fwrite($stream, $body, mb_strlen($body));
44
		rewind($stream);
45
		$body     = new Stream($stream);
46
		$response = new Response($status, [], $body);
47
48
		return $response;
49
	}
50
}
51