From 5df32fa657258117a991e1941dc9bfc4eba0766d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Tue, 27 May 2014 22:19:47 +0200 Subject: [PATCH] improved closure code & phpdoc --- .../core/ManiaExchange/ManiaExchangeManager.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/application/core/ManiaExchange/ManiaExchangeManager.php b/application/core/ManiaExchange/ManiaExchangeManager.php index e7d1dc48..dbfea50b 100644 --- a/application/core/ManiaExchange/ManiaExchangeManager.php +++ b/application/core/ManiaExchange/ManiaExchangeManager.php @@ -143,7 +143,7 @@ class ManiaExchangeManager { * Get the Whole MapList from MX by Mixed Uid and Id String fetch * * @param string $string - * @return array|null + * @return bool */ public function getMaplistByMixedUidIdString($string) { // Get Title Prefix @@ -155,18 +155,17 @@ class ManiaExchangeManager { $thisRef = $this; $success = $this->maniaControl->fileReader->loadFile($url, function ($mapInfo, $error) use ($thisRef, $titlePrefix, $url) { if ($error) { - trigger_error($error . " " . $url); - return null; + trigger_error("Error: '{$error}' for Url '{$url}'"); + return; } - if (!$mapInfo) { - return null; + return; } $mxMapList = json_decode($mapInfo); if ($mxMapList === null) { - trigger_error('Cannot decode searched JSON data from ' . $url); - return null; + trigger_error("Can't decode searched JSON Data from Url '{$url}'"); + return; } $maps = array(); @@ -180,7 +179,6 @@ class ManiaExchangeManager { } $thisRef->updateMapObjectsWithManiaExchangeIds($maps); - return true; }, "application/json"); return $success;