diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index a50b1b23..9e83ed25 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -10,7 +10,12 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML { 'chapter' => 'format_container_chunk', 'colophon' => 'format_chunk', 'function' => 'format_function', - 'methodname' => 'format_function', + 'methodname' => array( + /* DEFAULT */ 'format_function', + 'methodsynopsis' => 'format_methodsynopsis_function', + 'constructorsynopsis' => 'format_methodsynopsis_function', + 'destructorsynopsis' => 'format_methodsynopsis_function', + ), 'methodparam' => 'format_methodparam', 'methodsynopsis' => 'format_methodsynopsis', 'legalnotice' => 'format_chunk', @@ -840,6 +845,16 @@ public function format_function($open, $tag, $attrs, $props) { return ""; } + public function format_methodsynopsis_function($open, $tag, $attrs, $props) { + if ($open) { + return + 'function ' + . $this->format_function($open, $tag, $attrs, $props); + } + + return $this->format_function($open, $tag, $attrs, $props); + } + public function format_function_text($value, $tag, $display_value = null) { if ($this->getRole() === "function_replaceable") { return $this->TEXT($value); diff --git a/tests/package/php/bug49102-1.phpt b/tests/package/php/bug49102-1.phpt index 316809c7..98dc9cef 100644 --- a/tests/package/php/bug49102-1.phpt +++ b/tests/package/php/bug49102-1.phpt @@ -46,23 +46,23 @@ Content:
/* Methods */
- __construct()
+ function __construct() -
setIteratorMode(int $mode): void
+
function setIteratorMode(int $mode): void
/* Inherited methods */
-
SplDoublyLinkedList::bottom(): mixed
+
function SplDoublyLinkedList::bottom(): mixed
-
SplDoublyLinkedList::count(): int
+
function SplDoublyLinkedList::count(): int
-
SplDoublyLinkedList::current(): mixed
+
function SplDoublyLinkedList::current(): mixed
-
SplDoublyLinkedList::getIteratorMode(): int
+
function SplDoublyLinkedList::getIteratorMode(): int
-
SplDoublyLinkedList::offsetExists(mixed $index): bool
+
function SplDoublyLinkedList::offsetExists(mixed $index): bool
-
SplDoublyLinkedList::offsetGet(mixed $index): mixed
+
function SplDoublyLinkedList::offsetGet(mixed $index): mixed
} diff --git a/tests/package/php/bug_doc-en_GH-3179.phpt b/tests/package/php/bug_doc-en_GH-3179.phpt index 64a50d86..fae4d632 100644 --- a/tests/package/php/bug_doc-en_GH-3179.phpt +++ b/tests/package/php/bug_doc-en_GH-3179.phpt @@ -20,7 +20,7 @@ Filename: bug_doc-en_GH-3179.html Content:
-
method_name(): void
+
function method_name(): void
diff --git a/tests/package/php/class_and_method_link_rendering_001.phpt b/tests/package/php/class_and_method_link_rendering_001.phpt index f1f72648..b2746ea5 100644 --- a/tests/package/php/class_and_method_link_rendering_001.phpt +++ b/tests/package/php/class_and_method_link_rendering_001.phpt @@ -64,13 +64,13 @@ Content:

3. Class linking (non-FQN) in method/function parameter and return type

- +

4. Class linking (FQN) in method/function parameter and return type

- +
diff --git a/tests/package/php/class_rendering_001.phpt b/tests/package/php/class_rendering_001.phpt index 0448efcf..8499974f 100644 --- a/tests/package/php/class_rendering_001.phpt +++ b/tests/package/php/class_rendering_001.phpt @@ -27,7 +27,7 @@ Content:
Description -
public ClassName::__construct(string $firstParameter = "now")
+
public function ClassName::__construct(string $firstParameter = "now")

Returns new a ClassName object. diff --git a/tests/package/php/class_rendering_002.phpt b/tests/package/php/class_rendering_002.phpt index 302dbe6f..998deef8 100644 --- a/tests/package/php/class_rendering_002.phpt +++ b/tests/package/php/class_rendering_002.phpt @@ -27,7 +27,7 @@ Content:

Description -
public ClassName::__construct(string $firstParameter = "now")
+
public function ClassName::__construct(string $firstParameter = "now")

Returns new a ClassName object. diff --git a/tests/package/php/enum_link_rendering.phpt b/tests/package/php/enum_link_rendering.phpt index 1b59946b..a8b6cc78 100644 --- a/tests/package/php/enum_link_rendering.phpt +++ b/tests/package/php/enum_link_rendering.phpt @@ -41,13 +41,13 @@ Content:

2. Enum linking (non-FQN) in method/function parameter and return type

- +

3. Enum linking (FQN) in method/function parameter and return type

- +
diff --git a/tests/package/php/exception_rendering_001.phpt b/tests/package/php/exception_rendering_001.phpt index 9b6b440e..11ad3ce8 100644 --- a/tests/package/php/exception_rendering_001.phpt +++ b/tests/package/php/exception_rendering_001.phpt @@ -27,7 +27,7 @@ Content:
Description -
public ExceptionName::__construct(string $propertyName = "")
+
public function ExceptionName::__construct(string $propertyName = "")

Constructs the Exception. diff --git a/tests/package/php/exception_rendering_002.phpt b/tests/package/php/exception_rendering_002.phpt index 327feb50..8eed9073 100644 --- a/tests/package/php/exception_rendering_002.phpt +++ b/tests/package/php/exception_rendering_002.phpt @@ -27,7 +27,7 @@ Content:

Description -
public ExceptionName::__construct(string $propertyName = "")
+
public function ExceptionName::__construct(string $propertyName = "")

Constructs the Exception. diff --git a/tests/package/php/packagesynopsis_rendering_001.phpt b/tests/package/php/packagesynopsis_rendering_001.phpt index 6e8ba6b5..a9ffe9d9 100644 --- a/tests/package/php/packagesynopsis_rendering_001.phpt +++ b/tests/package/php/packagesynopsis_rendering_001.phpt @@ -42,7 +42,7 @@ Content:

- public floor(): BcMath\Number
+ public function floor(): BcMath\Number
}
diff --git a/tests/package/php/type_rendering_001.phpt b/tests/package/php/type_rendering_001.phpt index ad47bb16..7174e9b0 100644 --- a/tests/package/php/type_rendering_001.phpt +++ b/tests/package/php/type_rendering_001.phpt @@ -22,49 +22,49 @@ Content:

%d. Function/method with no return type

-
function_name()
+
function function_name()

%d. Function/method with one return type - never

-
function_name(): never
+
function function_name(): never

%d. Function/method with one return type - void

-
function_name(): void
+
function function_name(): void

%d. Function/method with one return type - mixed

-
function_name(): mixed
+
function function_name(): mixed

%d. Function/method with union return type

-
function_name(): int|float|false
+
function function_name(): int|float|false

%d. Function/method with nullable return type

-
function_name(): ?object
+
function function_name(): ?object

%d. Function/method with nullable union return type

- +
function function_name(): string|array|resource|callable|iterable|true|null

%d. Function/method with unknown return type

-
function_name(): UnknownType
+
function function_name(): UnknownType
diff --git a/tests/package/php/type_rendering_002.phpt b/tests/package/php/type_rendering_002.phpt index 2e99387a..0f3d0207 100644 --- a/tests/package/php/type_rendering_002.phpt +++ b/tests/package/php/type_rendering_002.phpt @@ -22,61 +22,61 @@ Content:

1. Function/method with no parameters

-
function_name()
+
function function_name()

2. Function/method with one parameter

-
function_name(mixed $anything)
+
function function_name(mixed $anything)

3. Function/method with optional parameter

-
function_name(int $count = 0)
+
function function_name(int $count = 0)

4. Function/method with nullable parameter

-
function_name(?float $value)
+
function function_name(?float $value)

5. Function/method with nullable optional parameter

-
function_name(?string $options = "")
+
function function_name(?string $options = "")

6. Function/method with reference parameter

-
function_name(array &$reference)
+
function function_name(array &$reference)

7. Function/method with union type parameter

-
function_name(iterable|resource|callable|null $option)
+
function function_name(iterable|resource|callable|null $option)

8. Function/method with intersection type parameter

-
function_name(Countable&Traversable $option)
+
function function_name(Countable&Traversable $option)

9. Function/method with DNF (Disjunctive Normal Form) type parameter

-
function_name((Countable&Traversable)|DOMAttr $option)
+
function function_name((Countable&Traversable)|DOMAttr $option)

10. Function/method with more than three parameters

-
function_name(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)
+
function function_name(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)
diff --git a/tests/package/php/type_rendering_003.phpt b/tests/package/php/type_rendering_003.phpt index 18aa17dd..c3ef92f3 100644 --- a/tests/package/php/type_rendering_003.phpt +++ b/tests/package/php/type_rendering_003.phpt @@ -22,61 +22,61 @@ Content:

%d. Constructor with no parameters, no return type

-
final public ClassName::__construct()
+
final public function ClassName::__construct()

%d. Constructor with one parameter

-
final private ClassName::__construct(mixed $anything)
+
final private function ClassName::__construct(mixed $anything)

%d. Constructor with optional parameter

-
final protected ClassName::__construct(int $count = 0)
+
final protected function ClassName::__construct(int $count = 0)

%d. Constructor with nullable parameter

-
final public ClassName::__construct(?float $value)
+
final public function ClassName::__construct(?float $value)

%d. Constructor with nullable optional parameter

-
final private ClassName::__construct(?string $options = "")
+
final private function ClassName::__construct(?string $options = "")

%d. Constructor with reference parameter

-
final protected ClassName::__construct(array &$reference)
+
final protected function ClassName::__construct(array &$reference)

%d. Constructor with union type parameter

-
final public ClassName::__construct(iterable|resource|callable|null $option)
+
final public function ClassName::__construct(iterable|resource|callable|null $option)

%d. Constructor with intersection type parameter

-
final public ClassName::__construct(Countable&Traversable $option)
+
final public function ClassName::__construct(Countable&Traversable $option)

%d. Constructor with DNF (Disjunctive Normal Form) type parameter

-
final public ClassName::__construct((Countable&Traversable)|DOMAttr $option)
+
final public function ClassName::__construct((Countable&Traversable)|DOMAttr $option)

%d. Constructor with more than three parameters

-
final private ClassName::__construct(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)
+
final private function ClassName::__construct(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)