1 | <?php |
||
42 | class AvatarManager implements IAvatarManager { |
||
43 | |||
44 | /** @var IUserManager */ |
||
45 | private $userManager; |
||
46 | |||
47 | /** @var IRootFolder */ |
||
48 | private $rootFolder; |
||
49 | |||
50 | /** @var IL10N */ |
||
51 | private $l; |
||
52 | |||
53 | /** @var ILogger */ |
||
54 | private $logger; |
||
55 | |||
56 | /** |
||
57 | * AvatarManager constructor. |
||
58 | * |
||
59 | * @param IUserManager $userManager |
||
60 | * @param IRootFolder $rootFolder |
||
61 | * @param IL10N $l |
||
62 | * @param ILogger $logger |
||
63 | */ |
||
64 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * return a user specific instance of \OCP\IAvatar |
||
77 | * @see \OCP\IAvatar |
||
78 | * @param string $userId the ownCloud user id |
||
79 | * @return \OCP\IAvatar |
||
80 | * @throws \Exception In case the username is potentially dangerous |
||
81 | * @throws NotFoundException In case there is no user folder yet |
||
82 | */ |
||
83 | public function getAvatar($userId) { |
||
92 | |||
93 | private function getFolder(Folder $folder, $path) { |
||
100 | |||
101 | private function buildAvatarPath($userId) { |
||
105 | |||
106 | /** |
||
107 | * Returns the avatar folder for the given user |
||
108 | * |
||
109 | * @param IUser $user user |
||
110 | * @return Folder|\OCP\Files\Node |
||
111 | * |
||
112 | * @internal |
||
113 | */ |
||
114 | public function getAvatarFolder(IUser $user) { |
||
122 | } |
||
123 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.