Help static code analysis to understand code.

It adds proper type hints to private namespace to allow private namespace methods.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-07-08 13:49:11 +02:00 committed by Morris Jobke
parent a72edb0d0e
commit 096fe20611
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
4 changed files with 14 additions and 7 deletions

View File

@ -36,7 +36,8 @@ namespace OCA\AdminAudit\AppInfo;
use Closure;
use OC\Files\Filesystem;
use OC\Files\Node\File;
use OC\Group\Manager;
use OC\Group\Manager as GroupManager;
use OC\User\Session as UserSession;
use OCA\AdminAudit\Actions\AppManagement;
use OCA\AdminAudit\Actions\Auth;
use OCA\AdminAudit\Actions\Console;
@ -134,6 +135,7 @@ class Application extends App implements IBootstrap {
Util::connectHook('OC_User', 'post_deleteUser', $userActions, 'delete');
Util::connectHook('OC_User', 'changeUser', $userActions, 'change');
assert($userSession instanceof UserSession);
$userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
$userSession->listen('\OC\User', 'assignedUserId', [$userActions, 'assign']);
$userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']);
@ -143,7 +145,7 @@ class Application extends App implements IBootstrap {
IGroupManager $groupManager) {
$groupActions = new GroupManagement($logger);
/** @var IGroupManager|Manager $groupManager */
assert($groupManager instanceof GroupManager);
$groupManager->listen('\OC\Group', 'postRemoveUser', [$groupActions, 'removeUser']);
$groupManager->listen('\OC\Group', 'postAddUser', [$groupActions, 'addUser']);
$groupManager->listen('\OC\Group', 'postDelete', [$groupActions, 'deleteGroup']);

View File

@ -35,6 +35,7 @@
namespace OCA\Settings\Controller;
use OC\Group\Manager as GroupManager;
use OC\HintException;
use OC\User\Session;
use OCP\App\IAppManager;
@ -58,7 +59,7 @@ class ChangePasswordController extends Controller {
/** @var IL10N */
private $l;
/** @var IGroupManager */
/** @var GroupManager */
private $groupManager;
/** @var Session */

View File

@ -38,7 +38,10 @@ use OC\Accounts\AccountManager;
use OC\AppFramework\Http;
use OC\Encryption\Exceptions\ModuleDoesNotExistsException;
use OC\ForbiddenException;
use OC\Group\Manager as GroupManager;
use OC\L10N\Factory;
use OC\Security\IdentityProof\Manager;
use OC\User\Manager as UserManager;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\Settings\BackgroundJobs\VerifyUserData;
use OCA\Settings\Events\BeforeTemplateRenderedEvent;
@ -63,9 +66,9 @@ use OCP\Mail\IMailer;
use function in_array;
class UsersController extends Controller {
/** @var IUserManager */
/** @var UserManager */
private $userManager;
/** @var IGroupManager */
/** @var GroupManager */
private $groupManager;
/** @var IUserSession */
private $userSession;
@ -77,7 +80,7 @@ class UsersController extends Controller {
private $l10n;
/** @var IMailer */
private $mailer;
/** @var IFactory */
/** @var Factory */
private $l10nFactory;
/** @var IAppManager */
private $appManager;

View File

@ -30,6 +30,7 @@
namespace OC\Group;
use OC\Group\Manager as GroupManager;
use OCP\IGroupManager;
use OCP\IUserSession;
@ -44,7 +45,7 @@ class MetaData {
protected $isAdmin;
/** @var array */
protected $metaData = [];
/** @var IGroupManager */
/** @var GroupManager */
protected $groupManager;
/** @var bool */
protected $sorting = false;