mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Simplify the output of api results
This commit is contained in:
parent
83056df565
commit
fb6c3e2912
5 changed files with 8 additions and 11 deletions
|
@ -348,13 +348,13 @@ class BaseApi extends BaseModule
|
|||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -382,7 +382,8 @@ class BaseApi extends BaseModule
|
|||
break;
|
||||
}
|
||||
|
||||
return $return;
|
||||
echo $return;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue