diff --git a/admin/Default/newsletter_send_processing.php b/admin/Default/newsletter_send_processing.php index 98197d366..53585aabe 100644 --- a/admin/Default/newsletter_send_processing.php +++ b/admin/Default/newsletter_send_processing.php @@ -8,7 +8,7 @@ $mail->Subject = $_REQUEST['subject']; -function set_mail_body(&$mail, $newsletterHtml, $newsletterText, $salutation) { +function set_mail_body($mail, $newsletterHtml, $newsletterText, $salutation) { // Prepend the salutation if one is given if ($salutation) { if (!empty($newsletterHtml)) { diff --git a/lib/Default/Menu.class.inc b/lib/Default/Menu.class.inc index 44716217f..bc21de5dc 100644 --- a/lib/Default/Menu.class.inc +++ b/lib/Default/Menu.class.inc @@ -291,7 +291,7 @@ class Menu { array('Link'=>Globals::getBarBlackjackHREF(), 'Text'=>'BlackJack'))); } - static function news(&$template) { + static function news(Template $template) { global $var; $menuItems = array(); if (SmrSession::getGameID() == $var['GameID']) { @@ -303,7 +303,7 @@ class Menu { $template->assign('MenuItems', $menuItems); } - static function navigation(&$template, &$player) { + static function navigation(Template $template, AbstractSmrPlayer $player) { $menuItems = array(); $menuItems[] = array('Link'=>Globals::getPlotCourseHREF(), 'Text'=>'Plot A Course'); if (!$player->isLandedOnPlanet()) diff --git a/lib/Default/Rankings.class.inc b/lib/Default/Rankings.class.inc index 6407c48e8..80e79ee64 100644 --- a/lib/Default/Rankings.class.inc +++ b/lib/Default/Rankings.class.inc @@ -3,7 +3,7 @@ class Rankings { private function __construct() {} - public static function &collectAllianceRankings(SmrMySqlDatabase &$db, AbstractSmrPlayer &$player, $rank) { + public static function &collectAllianceRankings(SmrMySqlDatabase $db, AbstractSmrPlayer $player, $rank) { $rankings = array(); while ($db->nextRecord()) { // increase rank counter @@ -28,7 +28,7 @@ class Rankings { return $rankings; } - public static function &collectRankings(SmrMySqlDatabase &$db, AbstractSmrPlayer $player, $rank) { + public static function &collectRankings(SmrMySqlDatabase $db, AbstractSmrPlayer $player, $rank) { $rankings = array(); while ($db->nextRecord()) { // increase rank counter diff --git a/lib/Default/missions.inc b/lib/Default/missions.inc index 35a144f41..e927aecbe 100644 --- a/lib/Default/missions.inc +++ b/lib/Default/missions.inc @@ -114,7 +114,7 @@ const MISSIONS = array( ) ); -function checkMissionRequirements(&$values, array &$mission, AbstractSmrPlayer &$player, array &$requirements = null) { +function checkMissionRequirements(&$values, array &$mission, AbstractSmrPlayer $player, array &$requirements = null) { if ($requirements == null) { return checkMissionRequirements($values, $mission, $player, $mission['Task']['Detail']); } diff --git a/lib/Default/news.functions.inc b/lib/Default/news.functions.inc index b28bb7227..1ae79740d 100644 --- a/lib/Default/news.functions.inc +++ b/lib/Default/news.functions.inc @@ -18,7 +18,7 @@ function getNewsItems(SmrMySqlDatabase $db) { return $newsItems; } -function doBreakingNewsAssign($gameID,&$template) { +function doBreakingNewsAssign($gameID, Template $template) { $db = new SmrMySqlDatabase(); $db->query('SELECT * FROM news WHERE game_id = '.$db->escapeNumber($gameID).' AND type = \'breaking\' AND time > '.$db->escapeNumber(TIME - TIME_FOR_BREAKING_NEWS).' ORDER BY time DESC LIMIT 1'); if ($db->nextRecord()) { @@ -26,7 +26,7 @@ function doBreakingNewsAssign($gameID,&$template) { } } -function doLottoNewsAssign($gameID,&$template) { +function doLottoNewsAssign($gameID, Template $template) { require_once(get_file_loc('bar.functions.inc')); checkForLottoWinner($gameID); $db = new SmrMySqlDatabase(); diff --git a/lib/Default/shop_goods.inc b/lib/Default/shop_goods.inc index c836b4cd0..1371428d5 100644 --- a/lib/Default/shop_goods.inc +++ b/lib/Default/shop_goods.inc @@ -1,6 +1,6 @@ getSectorID()!=$player->getSectorID()) return 'That port is not in this sector!'; diff --git a/tools/npc/npc.php b/tools/npc/npc.php index 7e89e2b07..606693b5e 100644 --- a/tools/npc/npc.php +++ b/tools/npc/npc.php @@ -471,7 +471,7 @@ function changeNPCLogin() { throw new ForwardException; } -function canWeUNO(AbstractSmrPlayer &$player, $oppurtunisticOnly) { +function canWeUNO(AbstractSmrPlayer $player, $oppurtunisticOnly) { if($player->getCredits()getShip(); @@ -525,7 +525,7 @@ function doUNO($hardwareID,$amount) { return create_container('shop_hardware_processing.php','',array('hardware_id'=>$hardwareID)); } -function tradeGoods($goodID,AbstractSmrPlayer &$player,SmrPort &$port) { +function tradeGoods($goodID, AbstractSmrPlayer $player, SmrPort $port) { sleepNPC(); //We have an extra sleep at port to make the NPC more vulnerable. $ship = $player->getShip(); $relations = $player->getRelation($port->getRaceID()); @@ -544,7 +544,7 @@ function tradeGoods($goodID,AbstractSmrPlayer &$player,SmrPort &$port) { return create_container('shop_goods_processing.php','',array('offered_price'=>$offeredPrice,'ideal_price'=>$idealPrice,'amount'=>$amount,'good_id'=>$goodID,'bargain_price'=>$offeredPrice)); } -function dumpCargo(&$player) { +function dumpCargo($player) { $ship = $player->getShip(); $cargo = $ship->getCargo(); debug('Ship Cargo',$cargo); @@ -555,11 +555,11 @@ function dumpCargo(&$player) { } } -function plotToSector(&$player,$sectorID) { +function plotToSector($player, $sectorID) { return create_container('course_plot_processing.php','',array('from'=>$player->getSectorID(),'to'=>$sectorID)); } -function plotToFed(&$player,$plotToHQ=false) { +function plotToFed($player, $plotToHQ=false) { debug('Plotting To Fed',$plotToHQ); if($plotToHQ === false && $player->getSector()->offersFederalProtection()) { @@ -578,7 +578,7 @@ function plotToFed(&$player,$plotToHQ=false) { // return plotToNearest($player,$plotToHQ===true?'HQ':'Fed'); } -function plotToNearest(AbstractSmrPlayer &$player, &$realX) { +function plotToNearest(AbstractSmrPlayer $player, $realX) { debug('Plotting To: ',$realX); //TODO: Can we make the debug output a bit nicer? if($player->getSector()->hasX($realX)) { //Check if current sector has what we're looking for before we attempt to plot and get error. @@ -588,12 +588,12 @@ function plotToNearest(AbstractSmrPlayer &$player, &$realX) { return create_container('course_plot_nearest_processing.php','',array('RealX'=>$realX)); } -function moveToSector(&$player,$targetSector) { +function moveToSector($player, $targetSector) { debug('Moving from #'.$player->getSectorID().' to #'.$targetSector); return create_container('sector_move_processing.php','',array('target_sector'=>$targetSector,'target_page'=>'')); } -function checkForShipUpgrade(AbstractSmrPlayer &$player) { +function checkForShipUpgrade(AbstractSmrPlayer $player) { foreach(SHIP_UPGRADE_PATH[$player->getRaceID()] as $upgradeShipID) { if($player->getShipTypeID()==$upgradeShipID) //We can't upgrade, only downgrade. return false; @@ -608,7 +608,7 @@ function checkForShipUpgrade(AbstractSmrPlayer &$player) { return false; } -function doShipUpgrade(AbstractSmrPlayer &$player,$upgradeShipID) { +function doShipUpgrade(AbstractSmrPlayer $player,$upgradeShipID) { $plotNearest = plotToNearest($player,AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()),$upgradeShipID)); if($plotNearest == true) { //We're already there! @@ -667,7 +667,7 @@ function leaveAlliance() { return create_container('alliance_leave_processing.php','',array('action'=>'YES')); } -function &findRoutes(&$player) { +function &findRoutes($player) { debug('Finding Routes'); $tradeGoods = array(GOOD_NOTHING => false);