ConflictsAnnotation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL, Commercial license.
5
 *
6
 * @package maslosoft/addendum
7
 * @licence AGPL, Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]> (Meta container, further improvements, bugfixes)
9
 * @copyright Copyright (c) Maslosoft (Meta container, further improvements, bugfixes)
10
 * @copyright Copyright (c) Jan Suchal (Original version, builder, parser)
11
 * @link https://maslosoft.com/addendum/ - maslosoft addendum
12
 * @link https://code.google.com/p/addendum/ - original addendum project
13
 */
14
15
namespace Maslosoft\Addendum\Annotations;
16
17
use Maslosoft\Addendum\Collections\MetaAnnotation;
18
use Maslosoft\Addendum\Interfaces\AnnotationInterface;
19
20
/**
21
 * Disallow annotation if some other annotation exists. This is to avoid using conflicting annotations.
22
 * 
23
 * This annotation can only be used on other annotation classes.
24
 * Only annotation name should be used here, *not* annotation class name.
25
 * 
26
 * Do not use class literals here. Only annotation name as string is recommended.
27
 * 
28
 * Assume we are defining `MyAnnotation` annotation, and want to forbid
29
 * using this annotation with `CombinedAnnotation`.
30
 * To achieve this use `Conflicts` annotation:
31
 * 
32
 * ```
33
 * @Conflicts('Combined')
34
 * ```
35
 * @Target(\Maslosoft\Addendum\Interfaces\AnnotationInterface)
36
 * @template Conflicts('${annotation}')
37
 * @see AnnotationInterface
38
 */
39
class ConflictsAnnotation extends MetaAnnotation
40
{
41
42
	public $value;
43
44
	public function init()
45
	{
46
		// Init not required, $value is directly used
47
	}
48
49
}
50