IdentityReference::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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