Completed
Pull Request — master (#2)
by Tomáš
09:20
created

IdentityReference   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 46
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClassName() 0 4 1
A getId() 0 4 1
A getRoles() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SixtyEightPublishers\User\DoctrineIdentity;
6
7
use Nette;
8
9
final class IdentityReference implements Nette\Security\IIdentity
10
{
11
	use Nette\SmartObject;
12
13
	/** @var string  */
14
	private $className;
15
16
	/** @var  */
17
	private $id;
18
19
	/**
20
	 * @param string $className
21
	 * @param mixed  $id
22
	 */
23
	public function __construct(string $className, $id)
24
	{
25
		$this->className = $className;
26
		$this->id = $id;
27
	}
28
29
	/**
30
	 * @return string
31
	 */
32
	public function getClassName(): string
33
	{
34
		return $this->className;
35
	}
36
37
	/************ interface \Nette\Security\IIdentity ************/
38
39
	/**
40
	 * {@inheritdoc}
41
	 */
42
	public function getId()
43
	{
44
		return $this->id;
45
	}
46
47
	/**
48
	 * {@inheritdoc}
49
	 */
50
	public function getRoles(): array
51
	{
52
		return [];
53
	}
54
}
55