Access   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAccessProperties() 0 4 1
1
<?php
2
3
namespace Accessible\Annotation;
4
5
/**
6
 * @Annotation
7
 * @Target("PROPERTY")
8
 */
9
class Access
10
{
11
    /**
12
     * The property can be accessed through a getX method.
13
     *
14
     * @var string
15
     */
16
    const GET = 'get';
17
18
    /**
19
     * The property can be accessed through a isX method.
20
     *
21
     * @var string
22
     */
23
    const IS = 'is';
24
25
    /**
26
     * The property X can be accessed through an X method.
27
     */
28
    const CALL = 'call';
29
30
    /**
31
     * The property can be modified through a setX method.
32
     *
33
     * @var string
34
     */
35
    const SET = 'set';
36
37
    /**
38
     * The list of access rights given to the property attached to this annotation
39
     *
40
     * @var array
41
     */
42
    private $accessProperties;
43
44
    /**
45
     * Initializes the annotation.
46
     *
47
     * @param array $accessProperties List of access rights given to the property.
48
     *                                The access should be in [GET,IS,SET].
49
     */
50 8
    public function __construct(array $accessProperties)
51
    {
52 8
        $this->accessProperties = $accessProperties['value'];
53 8
    }
54
55
    /**
56
     * Get the list of access rights on the property.
57
     *
58
     * @return array The list of access rights.
59
     */
60 7
    public function getAccessProperties()
61
    {
62 7
        return $this->accessProperties;
63
    }
64
}
65