}
/**
- * Formats the data according to the data type
+ * Outputs formatted data according to the data type and then exits the execution.
*
* @param string $root_element
* @param array $data An array with a single element containing the returned result
* @return false|string
*/
- protected static function format(string $root_element, array $data)
+ protected static function exit(string $root_element, array $data)
{
$return = self::formatData($root_element, self::$format, $data);
break;
}
- return $return;
+ echo $return;
+ exit;
}
/**