update callback methods

This commit is contained in:
kremsy 2014-02-19 17:37:37 +01:00 committed by Steffen Schröder
parent be5ca8e4ad
commit d6de80b592
5 changed files with 27 additions and 35 deletions

View File

@ -232,21 +232,19 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
/**
* Closes the widget
*
* @param array $callback
* @param \ManiaControl\Players\Player $player
*/
public function closeWidget(array $callback) {
$player = $callback[1];
public function closeWidget(Player $player) {
unset($this->adminListShown[$player->login]);
}
/**
* Unset the player if he opened another Main Widget
*
* @param array $callback
* @param Player $player
* @param $openedWidget
*/
public function handleWidgetOpened(array $callback) {
$player = $callback[1];
$openedWidget = $callback[2];
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened
if ($openedWidget != 'AdminList') {
unset($this->adminListShown[$player->login]);

View File

@ -166,11 +166,10 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
/**
* Unset the player if he opened another Main Widget
*
* @param array $callback
* @param Player $player
* @param $openedWidget
*/
public function handleWidgetOpened(array $callback) {
$player = $callback[1];
$openedWidget = $callback[2];
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened
if ($openedWidget != 'Configurator') {
unset($this->playersMenuShown[$player->login]);
@ -180,10 +179,9 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
/**
* Widget get closed -> unset player
*
* @param array $callback
* @param \ManiaControl\Players\Player $player
*/
public function closeWidget(array $callback) {
$player = $callback[1];
public function closeWidget(Player $player) {
unset($this->playersMenuShown[$player->login]);
}

View File

@ -307,14 +307,14 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
}
}
/**
* Unset the player if he opened another Main Widget
*
* @param array $callback
* @param Player $player
* @param $openedWidget
*/
public function handleWidgetOpened(array $callback) {
$player = $callback[1];
$openedWidget = $callback[2];
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened
if ($openedWidget != 'ManiaExchangeList') {
unset($this->mapListShown[$player->login]);
@ -324,10 +324,10 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
/**
* Closes the widget
*
* @param array $callback
* @param \ManiaControl\Players\Player $player
* @internal param array $callback
*/
public function closeWidget(array $callback) {
$player = $callback[1];
public function closeWidget(Player $player) {
unset($this->mapListShown[$player->login]);
}

View File

@ -451,11 +451,10 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
/**
* Unset the player if he opened another Main Widget
*
* @param array $callback
* @param Player $player
* @param $openedWidget
*/
public function handleWidgetOpened(array $callback) {
$player = $callback[1];
$openedWidget = $callback[2];
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened
if ($openedWidget != 'MapList') {
unset($this->mapListShown[$player->login]);
@ -465,10 +464,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
/**
* Closes the widget
*
* @param array $callback
* @param \ManiaControl\Players\Player $player
*/
public function closeWidget(array $callback) {
$player = $callback[1];
public function closeWidget(Player $player) {
unset($this->mapListShown[$player->login]);
}

View File

@ -598,11 +598,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
/**
* Unset the player if he opened another Main Widget
*
* @param array $callback
* @param Player $player
* @param $openedWidget
*/
public function handleWidgetOpened(array $callback) {
$player = $callback[1];
$openedWidget = $callback[2];
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened
if ($openedWidget != 'PlayerList') {
unset($this->playersListShown[$player->login]);
@ -612,10 +611,9 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
/**
* Closes the widget
*
* @param array $callback
* @param Player $player
*/
public function closeWidget(array $callback) {
$player = $callback[1];
public function closeWidget(Player $player) {
unset($this->playersListShown[$player->login]);
}