Skip to content

Commit

Permalink
update codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanashi committed Nov 1, 2024
1 parent b397c1f commit b718b6d
Showing 1 changed file with 29 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
<?php

namespace wcf\system\event\listener;

use wcf\system\user\jcoins\UserJCoinsStatementHandler;
use wcf\system\WCF;

class JCoinsTeamspeak3AddListener implements IParameterizedEventListener {
public function execute($eventObj, $className, $eventName, array &$parameters) {
if (!MODULE_JCOINS || !WCF::getUser()->userID) return;

if ($eventObj->getActionName() == 'create') {
$paramas = $eventObj->getParameters();

UserJCoinsStatementHandler::getInstance()->create('de.wcflabs.jcoins.statement.teamspeak3.start', null, [
'userID' => $paramas['data']['userID']
]);
} else if ($eventObj->getActionName() == 'delete') {
foreach ($eventObj->getObjects() as $object) {
UserJCoinsStatementHandler::getInstance()->revoke('de.wcflabs.jcoins.statement.teamspeak3.start', $object->getDecoratedObject(), [
'userID' => $object->userID
]);
}
}
}
}
class JCoinsTeamspeak3AddListener implements IParameterizedEventListener
{
public function execute($eventObj, $className, $eventName, array &$parameters)
{
if (!MODULE_JCOINS || !WCF::getUser()->userID) {
return;
}

if ($eventObj->getActionName() == 'create') {
$paramas = $eventObj->getParameters();

UserJCoinsStatementHandler::getInstance()->create('de.wcflabs.jcoins.statement.teamspeak3.start', null, [
'userID' => $paramas['data']['userID'],
]);
} elseif ($eventObj->getActionName() == 'delete') {
foreach ($eventObj->getObjects() as $object) {
UserJCoinsStatementHandler::getInstance()->revoke(
'de.wcflabs.jcoins.statement.teamspeak3.start',
$object->getDecoratedObject(),
[
'userID' => $object->userID,
]
);
}
}
}
}

0 comments on commit b718b6d

Please sign in to comment.