Code Duplication    Length = 45-45 lines in 2 locations

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

@@ 44-88 (lines=45) @@
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

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

@@ 32-76 (lines=45) @@
29
 * @link      https://github.com/appserver-io-psr/epb
30
 * @link      http://www.appserver.io
31
 */
32
class PersistenceUnit extends AbstractBeanAnnotation
33
{
34
35
    /**
36
     * The annotation for method, a bean has to be injected.
37
     *
38
     * @var string
39
     */
40
    const ANNOTATION = 'PersistenceUnit';
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 name attribute.
55
     *
56
     * @return string The annotations name attribute
57
     */
58
    public function getName()
59
    {
60
        if (isset($this->values[AnnotationKeys::NAME])) {
61
            return $this->values[AnnotationKeys::NAME];
62
        }
63
    }
64
65
    /**
66
     * Returns the value of the unitName attribute.
67
     *
68
     * @return string|null The annotations unitName attribute
69
     */
70
    public function getUnitName()
71
    {
72
        if (isset($this->values[AnnotationKeys::UNIT_NAME])) {
73
            return $this->values[AnnotationKeys::UNIT_NAME];
74
        }
75
    }
76
}
77