privilegeService = $privilegeService; $this->authService = $authService; $this->postService = $postService; $this->favoritesService = $favoritesService; $this->userViewProxy = $userViewProxy; } public function getMethods() { return ['GET']; } public function getUrl() { return '/api/posts/:postNameOrId/favorites'; } public function work($args) { $post = $this->postService->getByNameOrId($args['postNameOrId']); $users = $this->favoritesService->getFavoriteUsers($post); return ['users' => $this->userViewProxy->fromArray($users)]; } }