Code Duplication    Length = 12-12 lines in 3 locations

src/WebHemi/DataStorage/User/UserMetaStorage.php 1 location

@@ 56-67 (lines=12) @@
53
     *
54
     * @return bool|UserMetaEntity
55
     */
56
    public function getUserMetaById($identifier)
57
    {
58
        $entity = false;
59
        $data = $this->getDataAdapter()->getData($identifier);
60
61
        if (!empty($data)) {
62
            $entity = $this->createEntity();
63
            $this->populateEntity($entity, $data);
64
        }
65
66
        return $entity;
67
    }
68
69
    /**
70
     * Returns a User entity identified by (unique) Email.

src/WebHemi/DataStorage/User/UserStorage.php 2 locations

@@ 78-89 (lines=12) @@
75
     *
76
     * @return bool|UserEntity
77
     */
78
    public function getUserById($identifier)
79
    {
80
        $entity = false;
81
        $data = $this->getDataAdapter()->getData($identifier);
82
83
        if (!empty($data)) {
84
            $entity = $this->createEntity();
85
            $this->populateEntity($entity, $data);
86
        }
87
88
        return $entity;
89
    }
90
91
    /**
92
     * Returns a User entity identified by (unique) Email.
@@ 98-109 (lines=12) @@
95
     *
96
     * @return bool|UserEntity
97
     */
98
    public function getUserByEmail($email)
99
    {
100
        $entity = false;
101
        $dataList = $this->getDataAdapter()->getDataSet([$this->email => $email], 1);
102
103
        if (!empty($dataList)) {
104
            $entity = $this->createEntity();
105
            $this->populateEntity($entity, $dataList[0]);
106
        }
107
108
        return $entity;
109
    }
110
}
111