Access::getAccessProperties()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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