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áš
01:47
created

ApproveControlFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 8 2
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