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::getQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 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