Code Duplication    Length = 9-9 lines in 2 locations

code/model/LDAPGateway.php 2 locations

@@ 142-150 (lines=9) @@
139
     * @param array $attributes Restrict to specific AD attributes. An empty array will return all attributes
140
     * @return array
141
     */
142
    public function getGroupByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = [])
143
    {
144
        return $this->search(
145
            sprintf('(&(objectClass=group)(objectGUID=%s))', LDAPUtil::str_to_hex_guid($guid, true)),
146
            $baseDn,
147
            $scope,
148
            $attributes
149
        );
150
    }
151
152
    /**
153
     * Return a particular LDAP group by DN value.
@@ 197-205 (lines=9) @@
194
     * @param string $guid
195
     * @return array
196
     */
197
    public function getUserByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = [])
198
    {
199
        return $this->search(
200
            sprintf('(&(objectClass=user)(objectGUID=%s))', LDAPUtil::str_to_hex_guid($guid, true)),
201
            $baseDn,
202
            $scope,
203
            $attributes
204
        );
205
    }
206
207
    /**
208
     * Return a particular LDAP user by DN value.