[Releases3DSBridge] Remove nested functions

This commit is contained in:
Lyra 2019-10-03 21:46:09 +02:00
parent 3dae4e0801
commit 684c69b0cd

View file

@ -9,22 +9,6 @@ class Releases3DSBridge extends BridgeAbstract {
public function collectData(){ public function collectData(){
function typeToString($type){
switch($type) {
case 1: return '3DS Game';
case 4: return 'eShop';
default: return '??? (' . $type . ')';
}
}
function cardToString($card){
switch($card) {
case 1: return 'Regular (CARD1)';
case 2: return 'NAND (CARD2)';
default: return '??? (' . $card . ')';
}
}
$dataUrl = self::URI . 'xml.php'; $dataUrl = self::URI . 'xml.php';
$xml = getContents($dataUrl) $xml = getContents($dataUrl)
or returnServerError('Could not request 3dsdb: ' . $dataUrl); or returnServerError('Could not request 3dsdb: ' . $dataUrl);
@ -95,8 +79,8 @@ class Releases3DSBridge extends BridgeAbstract {
. '<br /><b>Release Name: </b>' . $releasename . '<br /><b>Release Name: </b>' . $releasename
. '<br /><b>Trimmed size: </b>' . intval(intval($trimmedsize) / 1048576) . '<br /><b>Trimmed size: </b>' . intval(intval($trimmedsize) / 1048576)
. 'MB<br /><b>Firmware: </b>' . $firmware . 'MB<br /><b>Firmware: </b>' . $firmware
. '<br /><b>Type: </b>' . typeToString($type) . '<br /><b>Type: </b>' . $this->typeToString($type)
. '<br /><b>Card: </b>' . cardToString($card) . '<br /><b>Card: </b>' . $this->cardToString($card)
. '<br />'; . '<br />';
//Build search links section to facilitate release search using search engines //Build search links section to facilitate release search using search engines
@ -124,4 +108,20 @@ class Releases3DSBridge extends BridgeAbstract {
$limit++; $limit++;
} }
} }
private function typeToString($type){
switch($type) {
case 1: return '3DS Game';
case 4: return 'eShop';
default: return '??? (' . $type . ')';
}
}
private function cardToString($card){
switch($card) {
case 1: return 'Regular (CARD1)';
case 2: return 'NAND (CARD2)';
default: return '??? (' . $card . ')';
}
}
} }