From 684c69b0cd05cd62a37faf869df298667970307b Mon Sep 17 00:00:00 2001 From: Lyra Date: Thu, 3 Oct 2019 21:46:09 +0200 Subject: [PATCH] [Releases3DSBridge] Remove nested functions --- bridges/Releases3DSBridge.php | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php index 6c159d12..fe2df8ec 100644 --- a/bridges/Releases3DSBridge.php +++ b/bridges/Releases3DSBridge.php @@ -9,22 +9,6 @@ class Releases3DSBridge extends BridgeAbstract { 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'; $xml = getContents($dataUrl) or returnServerError('Could not request 3dsdb: ' . $dataUrl); @@ -95,8 +79,8 @@ class Releases3DSBridge extends BridgeAbstract { . '
Release Name: ' . $releasename . '
Trimmed size: ' . intval(intval($trimmedsize) / 1048576) . 'MB
Firmware: ' . $firmware - . '
Type: ' . typeToString($type) - . '
Card: ' . cardToString($card) + . '
Type: ' . $this->typeToString($type) + . '
Card: ' . $this->cardToString($card) . '
'; //Build search links section to facilitate release search using search engines @@ -124,4 +108,20 @@ class Releases3DSBridge extends BridgeAbstract { $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 . ')'; + } + } }