* @inheritDoc
*/
public function create() {
- $returnValues = parent::create();
+ /** @var UserTrophy $userTrophy */
+ $userTrophy = parent::create();
- if (!$returnValues->getTrophy()->isDisabled()) {
- $userAction = new UserAction([$returnValues->userID], 'update', [
+ if (!$userTrophy->getTrophy()->isDisabled()) {
+ $userAction = new UserAction([$userTrophy->userID], 'update', [
'counters' => [
'trophyPoints' => 1
]
$userAction->executeAction();
}
- UserActivityEventHandler::getInstance()->fireEvent('com.woltlab.wcf.userTrophy.recentActivityEvent.trophyReceived', $returnValues->getObjectID(), null, $returnValues->userID);
+ UserActivityEventHandler::getInstance()->fireEvent('com.woltlab.wcf.userTrophy.recentActivityEvent.trophyReceived', $userTrophy->getObjectID(), null, $userTrophy->userID);
- UserNotificationHandler::getInstance()->fireEvent('received', 'com.woltlab.wcf.userTrophy.notification', new UserTrophyNotificationObject($returnValues), [
- $returnValues->userID
+ UserNotificationHandler::getInstance()->fireEvent('received', 'com.woltlab.wcf.userTrophy.notification', new UserTrophyNotificationObject($userTrophy), [
+ $userTrophy->userID
]);
- return $returnValues;
+ return $userTrophy;
}
/**
* @return LikeUserNotificationObject[]
*/
public static function getTestObjects(UserProfile $recipient, UserProfile $author) {
+ /** @var ILikeObject $likeObject */
$likeObject = self::createTestLikeObject($recipient, $author);
$likeObject->setObjectType(LikeHandler::getInstance()->getObjectType(self::getTestLikeableObjectTypeName()));