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.

Psr7Trait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 27
wmc 3
lcom 0
cbo 3
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createServerRequest() 0 4 1
A createResponse() 0 4 1
A createStream() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\NetteOAuth2Server\UI;
5
6
use Lookyman\NetteOAuth2Server\Psr7\Response;
7
use Lookyman\NetteOAuth2Server\Psr7\ApplicationPsr7ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
use Psr\Http\Message\StreamInterface;
10
use Zend\Diactoros\ServerRequestFactory;
11
use Zend\Diactoros\Stream;
12
13
trait Psr7Trait
14
{
15
	/**
16
	 * @return ServerRequestInterface
17
	 * @throws \InvalidArgumentException
18
	 */
19
	protected function createServerRequest(): ServerRequestInterface
20
	{
21
		return ServerRequestFactory::fromGlobals();
22
	}
23
24
	/**
25
	 * @return ApplicationPsr7ResponseInterface
26
	 */
27
	protected function createResponse(): ApplicationPsr7ResponseInterface
28
	{
29
		return new Response();
30
	}
31
32
	/**
33
	 * @return StreamInterface
34
	 */
35
	protected function createStream(): StreamInterface
36
	{
37
		return new Stream('php://temp', 'r+');
38
	}
39
}
40