diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php
index 6a7dc8e6..7e6e837a 100644
--- a/phpdotnet/phd/Package/Generic/XHTML.php
+++ b/phpdotnet/phd/Package/Generic/XHTML.php
@@ -145,7 +145,10 @@ abstract class Package_Generic_XHTML extends Format_Abstract_XHTML {
'methodsynopsis' => 'format_methodsynopsis',
'methodname' => 'format_methodname',
'member' => 'format_member',
- 'modifier' => 'format_modifier',
+ 'modifier' => array(
+ /* DEFAULT */ 'format_modifier',
+ 'methodparam' => 'format_methodparam_modifier',
+ ),
'note' => 'format_note',
'orgname' => 'span',
'othercredit' => 'format_div',
@@ -395,6 +398,10 @@ abstract class Package_Generic_XHTML extends Format_Abstract_XHTML {
'fieldsynopsis' => 'format_fieldsynopsis_modifier_text',
'methodparam' => 'format_modifier_text',
'methodsynopsis' => 'format_modifier_text',
+ 'constructorsynopsis' => 'format_modifier_text',
+ 'ooclass' => 'format_modifier_text',
+ 'ooexception' => 'format_modifier_text',
+ 'oointerface' => 'format_modifier_text',
),
/** Those are used to retrieve the class/interface name to be able to remove it from method names */
'classname' => [
@@ -1220,6 +1227,23 @@ public function format_fieldsynopsis_modifier_text($value, $tag) {
}
public function format_modifier($open, $name, $attrs, $props) {
+ if ($open) {
+ if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) {
+ $this->pushRole($attrs[Reader::XMLNS_DOCBOOK]["role"]);
+ return '';
+ }
+ return '';
+ }
+ if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) {
+ if ($attrs[Reader::XMLNS_DOCBOOK]["role"] === "attribute") {
+ return '
';
+ }
+ $this->popRole();
+ }
+ return '';
+ }
+
+ public function format_methodparam_modifier($open, $name, $attrs, $props) {
if ($open) {
if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) {
$this->pushRole($attrs[Reader::XMLNS_DOCBOOK]["role"]);
diff --git a/tests/package/generic/attribute_formatting_001.phpt b/tests/package/generic/attribute_formatting_001.phpt
index 6c060192..99afd149 100644
--- a/tests/package/generic/attribute_formatting_001.phpt
+++ b/tests/package/generic/attribute_formatting_001.phpt
@@ -48,13 +48,13 @@ Content:
3. Function parameter with unknown attribute
-$password
, string $hash
)$password
, string $hash
)4. Function parameter with known attribute
- +1. Class with unknown attributes
+2. Class with known attributes
+3. Method with unknown attributes
+4. Method with known attributes
+ + +5. Constructor with unknown attributes
+6. Constructor with known attributes
+ + +7. Class, constructor and methods with unknown attributes
+8. Class, constructor and methods with known attributes
+9. Function with unknown attributes
+10. Function with known attributes
+ + +