Code Duplication    Length = 12-12 lines in 2 locations

tests/php/Model/LDAPFakeGateway.php 2 locations

@@ 155-166 (lines=12) @@
152
     * @param array $attributes
153
     * @return array
154
     */
155
    public function getUserByEmail($email, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
156
    {
157
        $result = [];
158
        foreach (self::$data['users'] as $guid => $info) {
159
            if ($info['mail'] == $email) {
160
                $result[] = $info;
161
                break;
162
            }
163
        }
164
165
        return $result;
166
    }
167
168
    /**
169
     * Mock to search trough dummy $data.
@@ 178-189 (lines=12) @@
175
     * @return array
176
     * @internal param string $email
177
     */
178
    public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
179
    {
180
        $result = [];
181
        foreach (self::$data['users'] as $guid => $info) {
182
            if ($info['userprincipalname'] == $username) {
183
                $result[] = $info;
184
                break;
185
            }
186
        }
187
188
        return $result;
189
    }
190
}
191