Skip to content

Commit

Permalink
Merge pull request #12150 from nextcloud/techdebt/noid/ldap-rm-iusert…
Browse files Browse the repository at this point in the history
…ools

remove app specific IUserTools and consolidate test
  • Loading branch information
MorrisJobke authored Nov 1, 2018
2 parents bfab6cc + 0c5d912 commit d842cd1
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 179 deletions.
1 change: 0 additions & 1 deletion apps/user_ldap/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
'OCA\\User_LDAP\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php',
'OCA\\User_LDAP\\UserPluginManager' => $baseDir . '/../lib/UserPluginManager.php',
'OCA\\User_LDAP\\User\\DeletedUsersIndex' => $baseDir . '/../lib/User/DeletedUsersIndex.php',
'OCA\\User_LDAP\\User\\IUserTools' => $baseDir . '/../lib/User/IUserTools.php',
'OCA\\User_LDAP\\User\\Manager' => $baseDir . '/../lib/User/Manager.php',
'OCA\\User_LDAP\\User\\OfflineUser' => $baseDir . '/../lib/User/OfflineUser.php',
'OCA\\User_LDAP\\User\\User' => $baseDir . '/../lib/User/User.php',
Expand Down
1 change: 0 additions & 1 deletion apps/user_ldap/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class ComposerStaticInitUser_LDAP
'OCA\\User_LDAP\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php',
'OCA\\User_LDAP\\UserPluginManager' => __DIR__ . '/..' . '/../lib/UserPluginManager.php',
'OCA\\User_LDAP\\User\\DeletedUsersIndex' => __DIR__ . '/..' . '/../lib/User/DeletedUsersIndex.php',
'OCA\\User_LDAP\\User\\IUserTools' => __DIR__ . '/..' . '/../lib/User/IUserTools.php',
'OCA\\User_LDAP\\User\\Manager' => __DIR__ . '/..' . '/../lib/User/Manager.php',
'OCA\\User_LDAP\\User\\OfflineUser' => __DIR__ . '/..' . '/../lib/User/OfflineUser.php',
'OCA\\User_LDAP\\User\\User' => __DIR__ . '/..' . '/../lib/User/User.php',
Expand Down
3 changes: 1 addition & 2 deletions apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use OC\HintException;
use OC\Hooks\PublicEmitter;
use OCA\User_LDAP\Exceptions\ConstraintViolationException;
use OCA\User_LDAP\User\IUserTools;
use OCA\User_LDAP\User\Manager;
use OCA\User_LDAP\User\OfflineUser;
use OCA\User_LDAP\Mapping\AbstractMapping;
Expand All @@ -59,7 +58,7 @@
* Class Access
* @package OCA\User_LDAP
*/
class Access extends LDAPUtility implements IUserTools {
class Access extends LDAPUtility {
const UUID_ATTRIBUTES = ['entryuuid', 'nsuniqueid', 'objectguid', 'guid', 'ipauniqueid'];

/** @var \OCA\User_LDAP\Connection */
Expand Down
42 changes: 0 additions & 42 deletions apps/user_ldap/lib/User/IUserTools.php

This file was deleted.

10 changes: 5 additions & 5 deletions apps/user_ldap/lib/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* cache
*/
class Manager {
/** @var IUserTools */
/** @var Access */
protected $access;

/** @var IConfig */
Expand Down Expand Up @@ -110,11 +110,11 @@ public function __construct(IConfig $ocConfig,
}

/**
* @brief binds manager to an instance of IUserTools (implemented by
* Access). It needs to be assigned first before the manager can be used.
* @param IUserTools
* Binds manager to an instance of Access.
* It needs to be assigned first before the manager can be used.
* @param Access
*/
public function setLdapAccess(IUserTools $access) {
public function setLdapAccess(Access $access) {
$this->access = $access;
}

Expand Down
8 changes: 4 additions & 4 deletions apps/user_ldap/lib/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

namespace OCA\User_LDAP\User;

use OCA\User_LDAP\Access;
use OCA\User_LDAP\Connection;
use OCA\User_LDAP\FilesystemHelper;
use OCA\User_LDAP\LogWrapper;
Expand All @@ -48,7 +49,7 @@
*/
class User {
/**
* @var IUserTools
* @var Access
*/
protected $access;
/**
Expand Down Expand Up @@ -110,8 +111,7 @@ class User {
* @brief constructor, make sure the subclasses call this one!
* @param string $username the internal username
* @param string $dn the LDAP DN
* @param IUserTools $access an instance that implements IUserTools for
* LDAP interaction
* @param Access $access
* @param IConfig $config
* @param FilesystemHelper $fs
* @param Image $image any empty instance
Expand All @@ -120,7 +120,7 @@ class User {
* @param IUserManager $userManager
* @param INotificationManager $notificationManager
*/
public function __construct($username, $dn, IUserTools $access,
public function __construct($username, $dn, Access $access,
IConfig $config, FilesystemHelper $fs, Image $image,
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager,
INotificationManager $notificationManager) {
Expand Down
Loading

0 comments on commit d842cd1

Please sign in to comment.