1 | <?php |
||
44 | class AvatarManager implements IAvatarManager { |
||
45 | |||
46 | /** @var IUserManager */ |
||
47 | private $userManager; |
||
48 | |||
49 | /** @var IRootFolder */ |
||
50 | private $rootFolder; |
||
51 | |||
52 | /** @var IStorage */ |
||
53 | private $storage; |
||
54 | |||
55 | /** @var IL10N */ |
||
56 | private $l; |
||
57 | |||
58 | /** @var ILogger */ |
||
59 | private $logger; |
||
60 | |||
61 | /** |
||
62 | * AvatarManager constructor. |
||
63 | * |
||
64 | * @param IUserManager $userManager |
||
65 | * @param IRootFolder $rootFolder |
||
66 | * @param IL10N $l |
||
67 | * @param ILogger $logger |
||
68 | */ |
||
69 | public function __construct( |
||
79 | |||
80 | /** |
||
81 | * return a user specific instance of \OCP\IAvatar |
||
82 | * @see \OCP\IAvatar |
||
83 | * @param string $userId the ownCloud user id |
||
84 | * @return \OCP\IAvatar |
||
85 | * @throws \Exception In case the username is potentially dangerous |
||
86 | * @throws NotFoundException In case there is no user folder yet |
||
87 | */ |
||
88 | public function getAvatar($userId) { |
||
97 | |||
98 | /** |
||
99 | * Returns the avatar folder for the given user |
||
100 | * |
||
101 | * @return \OCP\Files\Storage\IStorage |
||
102 | * |
||
103 | * @throws NotFoundException |
||
104 | * @throws \OCP\Files\NotPermittedException |
||
105 | */ |
||
106 | private function getAvatarStorage() { |
||
116 | } |
||
117 |
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.