IdentityReference   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 44
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\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