mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
Explicitly type $userManager
Hi, I'm getting started on NC apps. On my app, the dependency injection only worked after declaring the type of UserManager explicitly. I'm not 100% sure, but it worked here. best, alan
This commit is contained in:
@@ -48,12 +48,13 @@ The hook logic should be in a separate class that is being registered in the :do
|
||||
|
||||
<?php
|
||||
namespace OCA\MyApp\Hooks;
|
||||
use OCP\IUserManager;
|
||||
|
||||
class UserHooks {
|
||||
|
||||
private $userManager;
|
||||
|
||||
public function __construct($userManager){
|
||||
public function __construct(IUserManager $userManager){
|
||||
$this->userManager = $userManager;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user