Code Duplication    Length = 39-57 lines in 3 locations

src/AppserverIo/Psr/EnterpriseBeans/Annotations/AbstractBeanAnnotation.php 1 location

@@ 34-72 (lines=39) @@
31
 * @link      https://github.com/appserver-io-psr/epb
32
 * @link      http://www.appserver.io
33
 */
34
abstract class AbstractBeanAnnotation extends ReflectionAnnotation
35
{
36
37
    /**
38
     * Returns the value of the name attribute.
39
     *
40
     * @return string|null The annotations name attribute
41
     */
42
    public function getName()
43
    {
44
        if (isset($this->values[AnnotationKeys::NAME])) {
45
            return $this->values[AnnotationKeys::NAME];
46
        }
47
    }
48
49
    /**
50
     * Returns the value of the description attribute.
51
     *
52
     * @return string|null The annotations description attribute
53
     */
54
    public function getDescription()
55
    {
56
        if (isset($this->values[AnnotationKeys::DESCRIPTION])) {
57
            return $this->values[AnnotationKeys::DESCRIPTION];
58
        }
59
    }
60
61
    /**
62
     * Returns the value of the lookup attribute.
63
     *
64
     * @return string|null The annotations lookup attribute
65
     */
66
    public function getLookup()
67
    {
68
        if (isset($this->values[AnnotationKeys::LOOKUP])) {
69
            return $this->values[AnnotationKeys::LOOKUP];
70
        }
71
    }
72
}
73

src/AppserverIo/Psr/EnterpriseBeans/Annotations/EnterpriseBean.php 1 location

@@ 44-100 (lines=57) @@
41
 * @link      https://github.com/appserver-io-psr/epb
42
 * @link      http://www.appserver.io
43
 */
44
class EnterpriseBean extends AbstractBeanAnnotation
45
{
46
47
    /**
48
     * The annotation for method, a bean has to be injected.
49
     *
50
     * @var string
51
     */
52
    const ANNOTATION = 'EnterpriseBean';
53
54
    /**
55
     * This method returns the class name as
56
     * a string.
57
     *
58
     * @return string
59
     */
60
    public static function __getClass()
61
    {
62
        return __CLASS__;
63
    }
64
65
    /**
66
     * Returns the value of the bean interface attribute.
67
     *
68
     * @return string|null The annotations bean interface attribute
69
     */
70
    public function getBeanInterface()
71
    {
72
        if (isset($this->values[AnnotationKeys::BEAN_INTERFACE])) {
73
            return $this->values[AnnotationKeys::BEAN_INTERFACE];
74
        }
75
    }
76
77
    /**
78
     * Returns the value of the bean name attribute.
79
     *
80
     * @return string|null The annotations bean Name attribute
81
     */
82
    public function getBeanName()
83
    {
84
        if (isset($this->values[AnnotationKeys::BEAN_NAME])) {
85
            return $this->values[AnnotationKeys::BEAN_NAME];
86
        }
87
    }
88
89
    /**
90
     * Returns the value of the lookup name attribute.
91
     *
92
     * @return string|null The annotations lookup name attribute
93
     */
94
    public function getLookup()
95
    {
96
        if (isset($this->values[AnnotationKeys::LOOKUP])) {
97
            return $this->values[AnnotationKeys::LOOKUP];
98
        }
99
    }
100
}
101

src/AppserverIo/Psr/EnterpriseBeans/Annotations/Inject.php 1 location

@@ 34-90 (lines=57) @@
31
 * @link      https://github.com/appserver-io-psr/epb
32
 * @link      http://www.appserver.io
33
 */
34
class Inject extends ReflectionAnnotation
35
{
36
37
    /**
38
     * The annotation for a default timeout method.
39
     *
40
     * @var string
41
     */
42
    const ANNOTATION = 'Inject';
43
44
    /**
45
     * This method returns the class name as
46
     * a string.
47
     *
48
     * @return string
49
     */
50
    public static function __getClass()
51
    {
52
        return __CLASS__;
53
    }
54
55
    /**
56
     * Returns the value of the name attribute.
57
     *
58
     * @return string|null The annotations name attribute
59
     */
60
    public function getName()
61
    {
62
        if (isset($this->values[AnnotationKeys::NAME])) {
63
            return $this->values[AnnotationKeys::NAME];
64
        }
65
    }
66
67
    /**
68
     * Returns the value of the description attribute.
69
     *
70
     * @return string|null The annotations description attribute
71
     */
72
    public function getDescription()
73
    {
74
        if (isset($this->values[AnnotationKeys::DESCRIPTION])) {
75
            return $this->values[AnnotationKeys::DESCRIPTION];
76
        }
77
    }
78
79
    /**
80
     * Returns the value of the type attribute.
81
     *
82
     * @return string The annotations type attribute
83
     */
84
    public function getType()
85
    {
86
        if (isset($this->values[AnnotationKeys::TYPE])) {
87
            return $this->values[AnnotationKeys::TYPE];
88
        }
89
    }
90
}
91