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:
Alan Tygel
2017-01-20 12:46:46 -03:00
committed by GitHub
parent 058dcf39f5
commit 2a2fd6d7c8

View File

@@ -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;
}