'div', /* Docbook-xsl prints "abstract"... */ 'abbrev' => 'abbr', 'acronym' => 'acronym', 'affiliation' => 'format_suppressed_tags', 'alt' => 'format_suppressed_tags', 'arg' => 'format_suppressed_tags', 'article' => 'format_container_chunk_top', 'author' => array( /* DEFAULT */ 'format_author', 'authorgroup' => 'format_authorgroup_author', ), 'authorgroup' => 'div', 'authorinitials' => 'format_entry', 'appendix' => 'format_container_chunk_top', 'application' => 'span', 'blockquote' => 'blockquote', 'bibliography' => array( /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'book' => 'format_container_chunk_top', 'chapter' => 'format_container_chunk_top', 'citetitle' => 'em', 'cmdsynopsis' => 'format_cmdsynopsis', 'co' => 'format_co', 'colophon' => 'format_chunk', 'copyright' => 'format_copyright', 'date' => array( /* DEFAULT */ 'p', 'revision' => 'format_entry', ), 'editor' => 'format_editor', 'edition' => 'format_suppressed_tags', 'email' => 'format_suppressed_tags', 'errortext' => 'code', 'firstname' => 'format_name', 'footnote' => 'format_footnote', 'footnoteref' => 'format_footnoteref', 'funcdef' => 'format_suppressed_tags', 'funcsynopsis' => 'div', 'funcsynopsisinfo' => 'pre', 'function' => 'span', 'funcprototype' => 'code', 'surname' => 'format_name', 'othername' => 'format_name', 'optional' => 'span', 'honorific' => 'span', 'glossary' => array( /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'calloutlist' => 'format_calloutlist', 'callout' => 'format_callout', 'caution' => 'format_admonition', 'citation' => 'format_citation', 'citerefentry' => 'span', 'code' => 'code', 'collab' => 'span', 'collabname' => 'span', 'contrib' => 'format_suppressed_tags', 'colspec' => 'format_colspec', 'command' => 'strong', 'computeroutput' => 'span', /* FIXME: This is one crazy stupid workaround for footnotes */ 'constant' => array( /* DEFAULT */ 'format_constant', 'para' => array( /* DEFAULT */ 'format_constant', 'footnote' => 'format_footnote_constant', ), ), 'constructorsynopsis' => 'format_methodsynopsis', 'destructorsynopsis' => 'format_methodsynopsis', 'emphasis' => 'format_emphasis', 'enumname' => 'span', 'entry' => array ( /* DEFAULT */ 'format_entry', 'row' => array( /* DEFAULT */ 'format_entry', 'thead' => 'format_th_entry', 'tfoot' => 'format_th_entry', 'tbody' => 'format_entry', ), ), 'envar' => 'var', 'errortype' => 'span', 'errorcode' => 'span', 'example' => 'format_example', 'formalpara' => 'p', 'fieldsynopsis' => array( /* DEFAULT */ 'format_fieldsynopsis', 'entry' => 'format_div', ), 'figure' => 'div', 'filename' => 'var', 'glossentry' => 'li', 'glossdef' => 'p', 'glosslist' => 'format_itemizedlist', 'glossterm' => 'span', 'holder' => 'span', 'imageobject' => 'format_div', 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'index' => array( /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'info' => array( /* DEFAULT */ 'format_div', 'note' => 'span', ), 'informalexample' => 'format_div', 'informaltable' => 'format_table', 'indexdiv' => 'format_dl', 'indexentry' => 'dd', 'initializer' => 'format_initializer', 'itemizedlist' => 'format_itemizedlist', 'keycap' => 'format_keycap', 'keycombo' => 'format_keycombo', 'legalnotice' => 'format_chunk', 'listitem' => array( /* DEFAULT */ 'li', 'varlistentry' => 'format_varlistentry_listitem', ), 'literal' => 'format_literal', 'literallayout' => 'pre', 'link' => 'format_link', 'xref' => 'format_xref', 'manvolnum' => 'format_manvolnum', 'inlinemediaobject' => 'format_mediaobject', 'mediaobject' => 'format_mediaobject', 'methodparam' => 'format_methodparam', 'methodsynopsis' => 'format_methodsynopsis', 'methodname' => 'format_methodname', 'member' => 'li', 'modifier' => 'span', 'note' => 'format_note', 'orgname' => 'span', 'othercredit' => 'format_div', /** Class Synopsis related tags */ 'classsynopsis' => 'format_classsynopsis', 'classsynopsisinfo' => 'format_classsynopsisinfo', 'ooclass' => array( /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_generic_oo_tag', ), 'ooexception' => [ /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_generic_oo_tag', ], 'oointerface' => array( /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_generic_oo_tag', 'classsynopsisinfo' => 'format_classsynopsisinfo_oointerface', ), 'classname' => [ /* DEFAULT */ 'span', 'ooclass' => [ /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_ooclass_classname', 'classsynopsisinfo' => 'format_classsynopsisinfo_ooclass_classname', ], ], 'exceptionname' => [ /* DEFAULT */ 'span', 'ooexception' => [ /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_ooclass_classname', ], ], 'interfacename' => array( /* DEFAULT */ 'span', 'oointerface' => array( /* DEFAULT */ 'span', 'classsynopsis' => 'format_classsynopsis_oointerface_interfacename', 'classsynopsisinfo' => 'format_classsynopsisinfo_oointerface_interfacename', ), ), 'option' => 'format_option', 'orderedlist' => 'format_orderedlist', 'para' => array( /* DEFAULT */ 'p', 'example' => 'format_example_content', 'footnote' => 'format_footnote_para', 'refsect1' => 'format_refsect1_para', 'question' => 'format_suppressed_tags', ), 'paramdef' => 'format_suppressed_tags', 'parameter' => array( /* DEFAULT */ 'format_parameter', 'methodparam' => 'format_methodparam_parameter', ), 'part' => 'format_container_chunk_top', 'partintro' => 'format_div', 'personname' => 'format_personname', 'personblurb' => 'format_div', 'phrase' => 'span', 'preface' => 'format_chunk', 'printhistory' => 'format_div', 'primaryie' => 'format_suppressed_tags', 'procedure' => 'format_procedure', 'productname' => 'span', 'programlisting' => 'format_programlisting', 'prompt' => 'span', 'propname' => 'span', 'property' => array( /* DEFAULT */ 'span', 'classsynopsisinfo' => 'format_varname', ), 'proptype' => 'span', 'pubdate' => 'format_div', /* Docbook-XSL prints "published" */ 'refentry' => 'format_chunk', 'refentrytitle' => 'span', 'refpurpose' => 'p', 'reference' => 'format_container_chunk_below', 'refsect1' => 'format_refsect', 'refsect2' => 'format_refsect', 'refsect3' => 'format_refsect', 'refsynopsisdiv' => 'div', 'refname' => 'h1', 'refnamediv' => 'div', 'releaseinfo' => 'div', 'replaceable' => 'span', 'revhistory' => 'format_table', 'revision' => 'format_row', 'revremark' => 'format_entry', 'row' => 'format_row', 'screen' => 'format_screen', 'screenshot' => 'format_div', 'sect1' => 'format_chunk', 'sect2' => 'div', 'sect3' => 'div', 'sect4' => 'div', 'sect5' => 'div', 'section' => array( /* DEFAULT */ 'div', 'sect1' => 'format_section_chunk', 'chapter' => 'format_section_chunk', 'appendix' => 'format_section_chunk', 'article' => 'format_section_chunk', 'part' => 'format_section_chunk', 'reference' => 'format_section_chunk', 'refentry' => 'format_section_chunk', 'index' => 'format_section_chunk', 'bibliography' => 'format_section_chunk', 'glossary' => 'format_section_chunk', 'colopone' => 'format_section_chunk', 'book' => 'format_section_chunk', 'set' => 'format_section_chunk', 'setindex' => 'format_section_chunk', 'legalnotice' => 'format_section_chunk', ), 'seg' => 'format_seg', 'segmentedlist' => 'format_segmentedlist', 'seglistitem' => 'format_seglistitem', 'segtitle' => 'format_suppressed_tags', 'set' => 'format_container_chunk_top', 'setindex' => 'format_chunk', 'shortaffil' => 'format_suppressed_tags', 'sidebar' => 'format_note', 'simplelist' => 'format_itemizedlist', /* FIXME: simplelists has few attributes that need to be implemented */ 'simplesect' => 'div', 'simpara' => array( /* DEFAULT */ 'p', 'note' => 'span', 'listitem' => 'span', 'entry' => 'span', 'example' => 'format_example_content', ), 'spanspec' => 'format_suppressed_tags', 'step' => 'format_step', 'superscript' => 'sup', 'subscript' => 'sub', 'systemitem' => 'format_systemitem', 'symbol' => 'span', 'synopsis' => 'pre', 'tag' => 'code', 'table' => 'format_table', 'firstterm' => 'format_term', 'term' => array( /* DEFAULT */ 'format_term', 'varlistentry' => 'format_varlistentry_term' ), 'tfoot' => 'format_th', 'tbody' => 'format_tbody', 'td' => 'format_th', 'th' => 'format_th', 'thead' => 'format_th', 'tgroup' => 'format_tgroup', 'tip' => 'format_admonition', 'title' => array( /* DEFAULT */ 'h1', 'example' => 'format_example_title', 'formalpara' => 'h5', 'info' => array( /* DEFAULT */ 'h1', 'example' => 'format_example_title', 'note' => 'format_note_title', 'table' => 'format_table_title', 'informaltable' => 'format_table_title', 'article' => 'format_container_chunk_top_title', 'appendix' => 'format_container_chunk_top_title', 'book' => 'format_container_chunk_top_title', 'chapter' => 'format_container_chunk_top_title', 'part' => 'format_container_chunk_top_title', 'set' => 'format_container_chunk_top_title', ), 'indexdiv' => 'dt', 'legalnotice' => 'h4', 'note' => 'format_note_title', 'phd:toc' => 'strong', 'procedure' => 'strong', 'refsect1' => 'h3', 'refsect2' => 'h4', 'refsect3' => 'h5', 'section' => 'h2', 'sect1' => 'h2', 'sect2' => 'h3', 'sect3' => 'h4', 'sect4' => 'h5', 'segmentedlist' => 'format_table_title', 'table' => 'format_table_title', 'variablelist' => 'format_variablelist_title', 'article' => 'format_container_chunk_top_title', 'appendix' => 'format_container_chunk_top_title', 'book' => 'format_container_chunk_top_title', 'chapter' => 'format_container_chunk_top_title', 'part' => 'format_container_chunk_top_title', 'set' => 'format_container_chunk_top_title', ), 'titleabbrev' => 'format_suppressed_tags', 'token' => 'code', 'tr' => 'format_row', 'trademark' => 'format_trademark', 'type' => 'span', 'userinput' => 'format_userinput', 'uri' => 'code', 'variablelist' => 'format_variablelist', 'varlistentry' => 'format_varlistentry', 'varname' => array( /* DEFAULT */ 'var', 'fieldsynopsis' => 'format_fieldsynopsis_varname', ), 'void' => 'format_void', 'warning' => 'format_admonition', 'xref' => 'format_xref', 'year' => 'span', 'quote' => 'q', 'qandaset' => 'format_qandaset', 'qandaentry' => 'dl', 'question' => array( /* DEFAULT */ 'format_question', 'questions' => 'format_phd_question', // From the PhD namespace ), 'questions' => 'ol', // From the PhD namespace 'answer' => 'dd', //phpdoc: implemented in the PHP Package 'phpdoc:classref' => 'format_suppressed_tags', 'phpdoc:exception' => 'format_suppressed_tags', 'phpdoc:exceptionref' => 'format_suppressed_tags', 'phpdoc:varentry' => 'format_suppressed_tags', //phd 'phd:toc' => 'format_phd_toc', ); /* }}} */ private $mytextmap = array( 'segtitle' => 'format_segtitle_text', 'affiliation' => 'format_suppressed_text', 'contrib' => 'format_suppressed_text', 'shortaffil' => 'format_suppressed_text', 'edition' => 'format_suppressed_text', 'programlisting' => 'format_programlisting_text', 'screen' => 'format_screen_text', 'alt' => 'format_alt_text', 'modifier' => array( /* DEFAULT */ false, 'fieldsynopsis' => 'format_fieldsynopsis_modifier_text', ), /** Those are used to retrieve the class/interface name to be able to remove it from method names */ 'classname' => [ /* DEFAULT */ false, 'ooclass' => [ /* DEFAULT */ false, /** This is also used by the legacy display to not display the class name at all */ 'classsynopsis' => 'format_classsynopsis_ooclass_classname_text', ] ], 'exceptionname' => [ /* DEFAULT */ false, 'ooexception' => [ /* DEFAULT */ false, 'classsynopsis' => 'format_classsynopsis_oo_name_text', ] ], 'interfacename' => [ /* DEFAULT */ false, 'oointerface' => [ /* DEFAULT */ false, 'classsynopsis' => 'format_classsynopsis_oo_name_text', ] ], 'methodname' => array( /* DEFAULT */ false, 'constructorsynopsis' => array( /* DEFAULT */ false, 'classsynopsis' => 'format_classsynopsis_methodsynopsis_methodname_text', ), 'methodsynopsis' => array( /* DEFAULT */ false, 'classsynopsis' => 'format_classsynopsis_methodsynopsis_methodname_text', ), 'destructorsynopsis' => array( /* DEFAULT */ false, 'classsynopsis' => 'format_classsynopsis_methodsynopsis_methodname_text', ), ), 'para' => array( /* DEFAULT */ false, 'footnote' => 'format_footnote_para_text', ), /* FIXME: This is one crazy stupid workaround for footnotes */ 'constant' => array( /* DEFAULT */ false, 'para' => array( /* DEFAULT */ false, 'footnote' => 'format_footnote_constant_text', ), ), 'literal' => 'format_literal_text', 'email' => 'format_email_text', 'titleabbrev' => 'format_suppressed_text', ); /** @var array */ protected $TOC_WRITTEN = []; /** @var string */ protected $CURRENT_LANG = ""; /** @var string */ protected $CURRENT_CHUNK = ""; /* Current Chunk variables */ protected $cchunk = array(); /* Default Chunk variables */ private $dchunk = array( "classsynopsis" => [ "close" => false, "classname" => false, "interface" => false, // bool: true when in interface "ooclass" => false, "oointerface" => false, "legacy" => true, // legacy rendering ], "classsynopsisinfo" => array( "implements" => false, "ooclass" => false, ), "examples" => 0, "fieldsynopsis" => array( "modifier" => "public", ), "methodsynopsis" => array( "returntypes" => [], "type_separator" => null, ), "co" => 0, "callouts" => 0, "segmentedlist" => array( "segtitleclosed" => false, "segtitleopened" => false, ), "table" => false, "procedure" => false, "mediaobject" => array( "alt" => false, ), "footnote" => array( ), "tablefootnotes" => array( ), "chunk_id" => null, "varlistentry" => array( "listitems" => array(), ), ); protected $pihandlers = array( 'dbhtml' => 'PI_DBHTMLHandler', 'dbtimestamp' => 'PI_DBHTMLHandler', ); protected $stylesheets = array(); protected $isSectionChunk = array(); protected $params = array(); public function __construct() { parent::__construct(); $this->registerPIHandlers($this->pihandlers); $this->setExt(Config::ext() === null ? ".html" : Config::ext()); } public function getDefaultElementMap() { return $this->myelementmap; } public function getDefaultTextMap() { return $this->mytextmap; } public function getChunkInfo() { return $this->cchunk; } public function getDefaultChunkInfo() { return $this->dchunk; } protected function createTOC($id, $name, $props, $depth = 1, $header = true) { if (!$this->getChildren($id) || $depth == 0) { return ""; } $toc = ''; if ($header) { $toc .= $this->getTocHeader($props); } $toc .= "
';
}
$this->role = false;
return '';
}
public function format_literal_text($value, $tag) {
switch ($this->role) {
case 'infdec':
$value = (float)$value;
$p = strpos($value, '.');
$str = substr($value, 0, $p + 1);
$str .= '';
$str .= substr($value, $p + 1);
$str .= '';
return $str;
default:
return $this->TEXT($value);
}
}
public function format_copyright($open, $name, $attrs) {
if ($open) {
return ''; break; default: return '
'; } } return '
'; } public function format_refsect($open, $name, $attrs) { static $role = 0; if ($open) { if(!isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { $attrs[Reader::XMLNS_DOCBOOK]["role"] = "unknown-" . ++$role; } $this->role = $role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; if (isset($attrs[Reader::XMLNS_XML]["id"])) { $id = $attrs[Reader::XMLNS_XML]["id"]; } else { $id = $name. "-" . $this->CURRENT_CHUNK . "-" . $role; } return '&' . $this->params["ellipsis"] . '$';
}
return ' ' . $this->params["ellipsis"] . '$';
}
return "";
}
public function format_initializer($open, $name, $attrs) {
if ($open) {
$this->params["init"] = true;
return ' = ';
}
return '';
}
public function format_parameter($open, $name, $attrs, $props)
{
if ($props["empty"]) {
return '';
}
if ($open) {
if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) {
return '&';
}
return '';
}
return "";
}
public function format_void($open, $name, $attrs, $props) {
if ($props['sibling'] == 'methodname') {
return '(';
} else {
return 'void';
}
}
public function format_methodparam($open, $name, $attrs) {
if ($open) {
$content = '';
if ($this->params["count"] === 0) {
$content .= "(";
if ($this->params["paramCount"] > 3) {
$content .= "
";
}
}
if (isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt") {
$this->params["opt"] = true;
} else {
$this->params["opt"] = false;
}
if ($this->params["count"]) {
$content .= ",";
if ($this->params["paramCount"] > 3) {
$content .= "
";
} else {
$content .= " ";
}
}
$content .= '';
++$this->params["count"];
if (isset($attrs[Reader::XMLNS_DOCBOOK]["rep"]) && $attrs[Reader::XMLNS_DOCBOOK]["rep"] == "repeat") {
$this->params["ellipsis"] = '...';
} else {
$this->params["ellipsis"] = '';
}
return $content;
}
if ($this->params["opt"] && !$this->params["init"]) {
return ' = ?';
}
$this->params["init"] = false;
return "";
}
public function format_methodname($open, $name, $attr) {
if ($open) {
return ' ';
}
return '';
}
public function format_varname($open, $name, $attrs) {
if ($open) {
return '$';
}
return "";
}
public function format_fieldsynopsis_varname($open, $name, $attrs) {
if ($open) {
if ($this->cchunk["fieldsynopsis"]["modifier"] === "const") {
return '';
}
return '$';
}
return '';
}
public function format_footnoteref($open, $name, $attrs, $props) {
if ($open) {
$linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"];
$found = false;
foreach($this->cchunk["footnote"] as $k => $note) {
if ($note["id"] === $linkend) {
return '[' .($k + 1). ']';
}
}
trigger_error("footnoteref ID '$linkend' not found", E_USER_WARNING);
return "";
}
}
public function format_footnote($open, $name, $attrs, $props) {
if ($open) {
$count = count($this->cchunk["footnote"]);
$noteid = isset($attrs[Reader::XMLNS_XML]["id"]) ? $attrs[Reader::XMLNS_XML]["id"] : $count + 1;
$note = array("id" => $noteid, "str" => "");
$this->cchunk["footnote"][$count] = $note;
if ($this->cchunk["table"]) {
$this->cchunk["tablefootnotes"][$count] = $noteid;
}
return '[' .($count + 1). ']';
}
return "";
}
/* {{{ FIXME: These are crazy workarounds :( */
public function format_footnote_constant($open, $name, $attrs, $props) {
$k = count($this->cchunk["footnote"]) - 1;
$this->cchunk["footnote"][$k]["str"] .= self::format_constant($open, $name, $attrs, $props);
return "";
}
public function format_footnote_constant_text($value, $tag) {
$k = count($this->cchunk["footnote"]) - 1;
$this->cchunk["footnote"][$k]["str"] .= $value;
return "";
}
public function format_footnote_para($open, $name, $attrs, $props) {
$k = count($this->cchunk["footnote"]) - 1;
if ($open) {
$this->cchunk["footnote"][$k]["str"] .= '';
return "";
}
$this->cchunk["footnote"][$k]["str"] .= "";
return "";
}
public function format_footnote_para_text($value, $tag) {
$k = count($this->cchunk["footnote"]) - 1;
$this->cchunk["footnote"][$k]["str"] .= $value;
return "";
}
/* }}} */
public function format_co($open, $name, $attrs, $props) {
if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"])) {
$co = ++$this->cchunk["co"];
return '' .str_repeat("*", $co) .'';
}
/* Suppress closing tag if any */
return "";
}
public function format_calloutlist($open, $name, $attrs) {
if ($open) {
$this->cchunk["callouts"] = 0;
return '';
}
return "";
}
public function format_systemitem($open, $name, $attrs) {
if ($open) {
$val = isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) ? $attrs[Reader::XMLNS_DOCBOOK]["role"] : null;
switch($val) {
case "directive":
/* FIXME: Different roles should probably be handled differently */
default:
return '';
}
}
return "";
}
public function format_example_content($open, $name, $attrs) {
if ($open) {
return ''; } return "
";
}
return "";
}
public function admonition_title($title, $lang)
{
return '' .($this->autogen($title, $lang)). '';
}
public function format_admonition($open, $name, $attrs, $props) {
if ($open) {
return '"; } public function format_note_title($open, $name, $attrs) { if ($open) { return ''; } return ''.$this->admonition_title("note", $props["lang"]). ': '; } return "
" . ($this->autogen('example', $props['lang']) . (isset($this->cchunk["examples"]) ? ++$this->cchunk["examples"] : "")) . " "; } return "
"; } public function format_table_title($open, $name, $attrs, $props) { if ($props["empty"]) { return ""; } if ($open) { return ""; } return "
"; } /** * Functions from the old XHTMLPhDFormat */ public function format_legalnotice_chunk($open, $name, $attrs) { if ($open) { return '' . $arFixes[$class][0];
}
public function format_dl($open, $name, $attrs, $props) {
if ($open) {
return '';
}
return '
';
}
public function format_itemizedlist($open, $name, $attrs, $props) {
if ($open) {
return '';
}
return '
';
}
public function format_orderedlist($open, $name, $attrs, $props) {
if ($open) {
$numeration = "1";
if (isset($attrs[Reader::XMLNS_DOCBOOK]["numeration"])) {
switch($attrs[Reader::XMLNS_DOCBOOK]["numeration"]) {
case "upperalpha":
$numeration = "A";
break;
case "loweralpha":
$numeration = "a";
break;
case "upperroman":
$numeration = "I";
break;
case "lowerroman":
$numeration = "i";
break;
}
}
return '';
}
return '
';
}
/* Support for key inputs is coded like junk */
public function format_keycap($open, $name, $attrs, $props) {
if ($open) {
$content = '';
if ($props['sibling']) {
$content = '+';
}
return $content . '';
}
return '';
}
public function format_keycombo($open, $name, $attrs, $props) {
if (isset($attrs[Reader::XMLNS_DOCBOOK]["action"])) {
if ($attrs[Reader::XMLNS_DOCBOOK]["action"] !== "simul") {
v('No support for keycombo action = %s', $attrs[Reader::XMLNS_DOCBOOK]["action"], E_USER_WARNING);
}
}
if ($open) {
return '';
}
return '';
}
public function format_whitespace($whitespace, $elementStack, $currentDepth) {
/* The following if is to skip unnecessary whitespaces in the parameter list */
if (
in_array($elementStack[$currentDepth - 1], ['methodsynopsis', 'constructorsynopsis', 'destructorsynopsis'], true)
&& (in_array($elementStack[$currentDepth] ?? "", ["methodname", "methodparam", "type", "void"], true)
|| count($elementStack) === $currentDepth)
) {
return false;
}
/* The following if is to skip whitespace before closing semicolon after property/class constant */
if ($elementStack[$currentDepth - 1] === "fieldsynopsis" && (in_array($elementStack[$currentDepth], ["varname", "initializer"], true))) {
return false;
}
/*
TODO: add trim() in type_text handling method and remove the below
as it doesn't work due to XMLReader including all whitespace
inside the tag in the text
hence no separate significant whitespace here
*/
/* The following if is to skip whitespace inside type elements */
if ($elementStack[$currentDepth - 1] === "type") {
return false;
}
/* The following if is to skip unnecessary whitespaces in the implements list */
if (
($elementStack[$currentDepth - 1] === 'classsynopsisinfo' && $elementStack[$currentDepth] === 'oointerface') ||
($elementStack[$currentDepth - 1] === 'oointerface' && $elementStack[$currentDepth] === 'interfacename')
) {
return false;
}
return $whitespace;
}
}