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
Pull Request — master (#10)
by Lukáš
07:03
created

ApproveControlFactory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Lookyman\Nette\OAuth2\Server\UI;
6
7
use League\OAuth2\Server\AuthorizationServer;
8
use League\OAuth2\Server\RequestTypes\AuthorizationRequest;
9
use Nette\Http\Session;
10
use Psr\Log\LoggerAwareInterface;
11
use Psr\Log\LoggerAwareTrait;
12
13
final class ApproveControlFactory implements IApproveControlFactory, LoggerAwareInterface
14
{
15
	use LoggerAwareTrait;
16
17
	/**
18
	 * @var AuthorizationServer
19
	 */
20
	private $authorizationServer;
21
22
	/**
23
	 * @var Session
24
	 */
25
	private $session;
26
27
	public function __construct(AuthorizationServer $authorizationServer, Session $session)
28
	{
29
		$this->authorizationServer = $authorizationServer;
30
		$this->session = $session;
31
	}
32
33
	public function create(AuthorizationRequest $authorizationRequest): ApproveControl
34
	{
35
		$control = new ApproveControl($this->authorizationServer, $this->session, $authorizationRequest);
36
		if ($this->logger) {
37
			$control->setLogger($this->logger);
38
		}
39
		return $control;
40
	}
41
42
}
43