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.

ApproveControlFactory::create()   A
last analyzed

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