Completed
Push — master ( 305309...6586da )
by Tim
11s
created

Inject   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __getClass() 0 4 1
A getType() 0 6 2
A getFactory() 0 6 2
A getBeanName() 0 6 2
A getFactoryType() 0 6 2
A getFactoryMethod() 0 6 2
1
<?php
2
3
/**
4
 * AppserverIo\Psr\EnterpriseBeans\Annotations\Inject
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2015 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io-psr/apb
18
 * @link      http://www.appserver.io
19
 */
20
21
namespace AppserverIo\Psr\EnterpriseBeans\Annotations;
22
23
/**
24
 * Annotation implementation representing a @Inject annotation on a class method/property.
25
 *
26
 * @author    Tim Wagner <[email protected]>
27
 * @copyright 2015 TechDivision GmbH <[email protected]>
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/appserver-io-psr/epb
30
 * @link      http://www.appserver.io
31
 */
32
class Inject extends AbstractBeanAnnotation
33
{
34
35
    /**
36
     * The annotation for a default timeout method.
37
     *
38
     * @var string
39
     */
40
    const ANNOTATION = 'Inject';
41
42
    /**
43
     * This method returns the class name as
44
     * a string.
45
     *
46
     * @return string
47
     */
48
    public static function __getClass()
49
    {
50
        return __CLASS__;
51
    }
52
53
    /**
54
     * Returns the value of the bean name attribute.
55
     *
56
     * @return string|null The annotations bean Name attribute
57
     */
58
    public function getBeanName()
59
    {
60
        if (isset($this->values[AnnotationKeys::BEAN_NAME])) {
61
            return $this->values[AnnotationKeys::BEAN_NAME];
62
        }
63
    }
64
65
    /**
66
     * Returns the value of the type attribute.
67
     *
68
     * @return string The annotations type attribute
69
     */
70
    public function getType()
71
    {
72
        if (isset($this->values[AnnotationKeys::TYPE])) {
73
            return $this->values[AnnotationKeys::TYPE];
74
        }
75
    }
76
77
    /**
78
     * Returns the value of the factory attribute.
79
     *
80
     * @return string The annotations factory attribute
81
     */
82
    public function getFactory()
83
    {
84
        if (isset($this->values[AnnotationKeys::FACTORY])) {
85
            return $this->values[AnnotationKeys::FACTORY];
86
        }
87
    }
88
89
    /**
90
     * Returns the value of the factory type attribute.
91
     *
92
     * @return string The annotations factory type attribute
93
     */
94
    public function getFactoryType()
95
    {
96
        if (isset($this->values[AnnotationKeys::FACTORY_TYPE])) {
97
            return $this->values[AnnotationKeys::FACTORY_TYPE];
98
        }
99
    }
100
101
    /**
102
     * Returns the value of the factory method attribute.
103
     *
104
     * @return string The annotations factory method attribute
105
     */
106
    public function getFactoryMethod()
107
    {
108
        if (isset($this->values[AnnotationKeys::FACTORY_METHOD])) {
109
            return $this->values[AnnotationKeys::FACTORY_METHOD];
110
        }
111
    }
112
}
113