[XML/HTML Outputter] General improvements and refactoring as well as some bug fixes

This commit is contained in:
Diogo Cordeiro
2019-05-06 23:58:45 +01:00
parent c03ed457a6
commit 1536d3ef29
20 changed files with 1651 additions and 1567 deletions

View File

@@ -42,27 +42,26 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @see Action
* @see HTMLOutputter
*/
class XMLStringer extends XMLOutputter
{
function __construct($indent=false)
public function __construct($indent = false)
{
$this->xw = new XMLWriter();
$this->xw->openMemory();
$this->xw->setIndent($indent);
}
function getString()
{
return $this->xw->outputMemory();
}
// utility for quickly creating XML-strings
static function estring($tag, $attrs=null, $content=null)
public static function estring($tag, $attrs = null, $content = null)
{
$xs = new XMLStringer();
$xs->element($tag, $attrs, $content);
return $xs->getString();
}
}
// utility for quickly creating XML-strings
public function getString()
{
return $this->xw->outputMemory();
}
}