CollectionNameAnnotation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL or Commercial license.
5
 *
6
 * @package maslosoft/mangan
7
 * @licence AGPL or Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]>
9
 * @copyright Copyright (c) Maslosoft
10
 * @copyright Copyright (c) Others as mentioned in code
11
 * @link https://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Annotations;
15
16
use Maslosoft\Mangan\Meta\ManganTypeAnnotation;
17
18
/**
19
 * CollectionName
20
 * Use this annotation to set custom collection name
21
 * @Target('class')
22
 * @template CollectionName('${name}')
23
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
24
 */
25
class CollectionNameAnnotation extends ManganTypeAnnotation
26
{
27
28
	public $value;
29
30 4
	public function init()
31
	{
32 4
		$this->getEntity()->collectionName = $this->value;
33 4
	}
34
35
}
36