From cdc94807fba2f05a99b5aebe9f84c069972bb52f Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 11 Feb 2024 22:20:07 +0100 Subject: [PATCH 1/7] Add links to all type tags --- phpdotnet/phd/Package/Generic/XHTML.php | 4 +- phpdotnet/phd/Package/PHP/XHTML.php | 180 +++++++++++++----- tests/php/bug49102-1.phpt | 16 +- ...ndering_constructorsynopsis_parameters.xml | 78 ++++++++ ...pe_rendering_methodsynopsis_parameters.xml | 78 ++++++++ ..._rendering_methodsynopsis_return_types.xml | 74 +++++++ tests/php/type_rendering_001.phpt | 94 +++++++++ tests/php/type_rendering_002.phpt | 94 +++++++++ tests/php/type_rendering_003.phpt | 94 +++++++++ 9 files changed, 654 insertions(+), 58 deletions(-) create mode 100644 tests/php/data/type_rendering_constructorsynopsis_parameters.xml create mode 100644 tests/php/data/type_rendering_methodsynopsis_parameters.xml create mode 100644 tests/php/data/type_rendering_methodsynopsis_return_types.xml create mode 100644 tests/php/type_rendering_001.phpt create mode 100644 tests/php/type_rendering_002.phpt create mode 100644 tests/php/type_rendering_003.phpt diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 256aa71a7..a9800ec41 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -1277,10 +1277,10 @@ public function format_parameter($open, $name, $attrs, $props) } public function format_void($open, $name, $attrs, $props) { - if ($props['sibling'] == 'methodname') { + if (isset($props['sibling']) && $props['sibling'] == 'methodname') { return '('; } else { - return 'void'; + return 'void'; } } diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index 7c59b05b4..a4749e212 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -11,8 +11,13 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML { 'colophon' => 'format_chunk', 'function' => 'format_function', 'methodname' => 'format_function', + 'methodparam' => 'format_methodparam', 'methodsynopsis' => 'format_methodsynopsis', 'legalnotice' => 'format_chunk', + 'parameter' => array( + /* DEFAULT */ 'format_parameter', + 'methodparam' => 'format_methodparam_parameter', + ), 'part' => 'format_container_chunk', 'partintro' => 'format_partintro', 'preface' => 'format_chunk', @@ -70,9 +75,11 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML { 'type' => array( /* DEFAULT */ 'format_type', 'methodsynopsis' => 'format_methodsynopsis_type', + 'methodparam' => 'format_type_methodparam', 'type' => array( /* DEFAULT */ 'format_type', 'methodsynopsis' => 'format_suppressed_tags', + 'methodparam' => 'format_suppressed_tags', ), ), 'varname' => array( @@ -120,14 +127,15 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML { ), 'refname' => 'format_refname_text', 'type' => array( - /* DEFAULT */ 'format_type_if_object_or_pseudo_text', + /* DEFAULT */ 'format_type_text', 'classsynopsisinfo' => false, - 'fieldsynopsis' => 'format_type_if_object_or_pseudo_text', - 'methodparam' => 'format_type_if_object_or_pseudo_text', + 'fieldsynopsis' => 'format_type_text', + 'methodparam' => 'format_type_methodparam_text', 'methodsynopsis' => 'format_type_methodsynopsis_text', 'type' => array( - /* DEFAULT */ 'format_type_if_object_or_pseudo_text', + /* DEFAULT */ 'format_type_text', 'methodsynopsis' => 'format_type_methodsynopsis_text', + 'methodparam' => 'format_type_methodparam_text', ), ), 'titleabbrev' => array( @@ -481,40 +489,19 @@ public function format_methodsynopsis($open, $name, $attrs, $props) { $content = ""; if ($this->params["paramCount"] > 3) { $content .= "
"; + } else if ($this->params["paramCount"] === 0) { + $content .= "("; } $content .= ")"; if ($this->cchunk["methodsynopsis"]["returntypes"]) { - $types = []; - $this->type_separator = $this->cchunk["methodsynopsis"]["type_separator"]; - - if ( - $this->type_separator === "|" && - count($this->cchunk["methodsynopsis"]["returntypes"]) === 2 && - in_array("null", $this->cchunk["methodsynopsis"]["returntypes"], true) - ) { - $this->simple_nullable = true; - $this->type_separator = ""; - $types[] = '?'; - } + $type = $this->format_types( + $this->cchunk["methodsynopsis"]["type_separator"], + $this->cchunk["methodsynopsis"]["returntypes"] + ); - foreach ($this->cchunk["methodsynopsis"]["returntypes"] as $return_type) { - $formatted_type = self::format_type_if_object_or_pseudo_text($return_type, "type"); - if ($formatted_type === false) { - $formatted_type = $return_type; - } - if ($formatted_type !== "") { - $types[] = '' . $formatted_type . ''; - } - } - - $type = implode($this->type_separator ?? '', $types); - if (count($types) > 1) { - $type = '' . $type . ''; - } $content .= ': ' . $type; - $this->simple_nullable = null; } $content .= "\n"; @@ -523,29 +510,109 @@ public function format_methodsynopsis($open, $name, $attrs, $props) { return $content; } + private function format_types($type_separator, $paramOrReturnType) { + $types = []; + $this->type_separator = $type_separator; + + if ( + $this->type_separator === "|" && + count($paramOrReturnType) === 2 && + in_array("null", $paramOrReturnType, true) + ) { + $this->simple_nullable = true; + $this->type_separator = ""; + $formatted_type = self::format_type_text("?", "type"); + $types[] = '' . $formatted_type .''; + } + + foreach ($paramOrReturnType as $individualType) { + $formatted_type = self::format_type_text($individualType, "type"); + if ($formatted_type === false) { + $formatted_type = $individualType; + } + if ($formatted_type !== "") { + if ($individualType === "void") { + $types[] = $formatted_type; + } else { + $types[] = '' . $formatted_type . ''; + } + } + } + + $type = implode($this->type_separator ?? '', $types); + if (count($types) > 1) { + $type = '' . $type . ''; + } + $this->simple_nullable = null; + + return $type; + } + public function format_type_methodsynopsis_text($type, $tagname) { $this->cchunk["methodsynopsis"]["returntypes"][] = $type; return ""; } - public function format_type_if_object_or_pseudo_text($type, $tagname) { - if (strtolower($type) === "null" && $this->simple_nullable) { - return ""; + public function format_methodparam_parameter($open, $name, $attrs, $props) { + $type = ""; + if ($open) { + if ($this->cchunk["methodparam"]["paramtypes"]) { + $type = $this->format_types( + $this->cchunk["methodparam"]["type_separator"], + $this->cchunk["methodparam"]["paramtypes"] + ); + } + $this->cchunk["methodparam"]["type_separator"] = ""; + $this->cchunk["methodparam"]["paramtypes"] = []; + } + return $type . parent::format_methodparam_parameter($open, $name, $attrs, $props); + } + + public function format_methodparam($open, $name, $attrs) { + if ($open) { + $this->cchunk["methodparam"]["paramtypes"] = []; + $this->cchunk["methodparam"]["type_separator"] = ""; + return parent::format_methodparam($open, $name, $attrs); } - if (in_array(strtolower($type), array("bool", "int", "double", "boolean", "integer", "float", "string", "array", "object", "resource", "null"))) { - return false; + if ($this->params["opt"] && !$this->params["init"]) { + return ' = ?'; } + $this->params["init"] = false; + $this->cchunk["methodparam"]["paramtypes"] = []; + $this->cchunk["methodparam"]["type_separator"] = ""; + return ""; + } - return self::format_type_text($type, $tagname); + public function format_type_methodparam($open, $tag, $attrs) { + if ($open) { + if (isset($attrs[Reader::XMLNS_DOCBOOK]["class"])) { + if ($attrs[Reader::XMLNS_DOCBOOK]["class"] === "union") { + $this->cchunk["methodparam"]["type_separator"] = "|"; + } else { + $this->cchunk["methodparam"]["type_separator"] = "&"; + } + } + $this->cchunk["methodparam"]["paramtypes"] = []; + } + return ""; + } + + public function format_type_methodparam_text($type, $tagname) { + $this->cchunk["methodparam"]["paramtypes"][] = $type; + + return ""; } public function format_type_text($type, $tagname) { + $type = trim($type); $t = strtr(strtolower($type), ["_" => "-", "\\" => "-"]); $href = $fragment = ""; switch($t) { + case "void": + return $this->format_void(false, '', [], []); case "bool": $href = "language.types.boolean"; break; @@ -555,6 +622,17 @@ public function format_type_text($type, $tagname) { case "double": $href = "language.types.float"; break; + case "?": + $href = "language.types.null"; + break; + case "false": + case "true": + $href = "language.types.value"; + break; + case "null": + if ($this->simple_nullable) { + return ""; + } case "boolean": case "integer": case "float": @@ -562,30 +640,36 @@ public function format_type_text($type, $tagname) { case "array": case "object": case "resource": - case "null": - if ($this->simple_nullable) { - return ""; - } case "callable": case "iterable": - $href = "language.types.$t"; - break; case "mixed": - $href = "language.types.declarations"; - $fragment = "language.types.declarations.$t"; + case "never": + $href = "language.types.$t"; break; default: /* Check if its a classname. */ $href = Format::getFilename("class.$t"); } + if ($href === false) { + return false; + } + + $classNames = ($type === "?") ? ($tagname . ' null') : ($tagname . ' ' . $type); if ($href && $this->chunked) { - return '' .$type. ''; + return '' .$type. ''; } if ($href) { - return '' .$type. ''; + return '' .$type. ''; + } + return '' .$type. ''; + } + + public function format_void($open, $name, $attrs, $props) { + if (isset($props['sibling']) && $props['sibling'] == 'methodname') { + return ''; } - return '' .$type. ''; + return parent::format_void($open, $name, $attrs, $props); } public function format_example_title($open, $name, $attrs, $props) { diff --git a/tests/php/bug49102-1.phpt b/tests/php/bug49102-1.phpt index d3f0f0ffe..273f03dbb 100644 --- a/tests/php/bug49102-1.phpt +++ b/tests/php/bug49102-1.phpt @@ -65,24 +65,24 @@ Content:
__construct()
-
setIteratorMode(int $mode): void
+
setIteratorMode(int $mode): void
/* Inherited methods */
-
SplDoublyLinkedList::bottom(): mixed
+
SplDoublyLinkedList::bottom(): mixed
-
SplDoublyLinkedList::count(): int
+
SplDoublyLinkedList::count(): int
-
SplDoublyLinkedList::current(): mixed
+
SplDoublyLinkedList::current(): mixed
-
SplDoublyLinkedList::getIteratorMode(): int
+
SplDoublyLinkedList::getIteratorMode(): int
-
SplDoublyLinkedList::offsetExists(mixed $index): bool
+
SplDoublyLinkedList::offsetExists(mixed $index): bool
-
SplDoublyLinkedList::offsetGet(mixed $index): mixed
+
SplDoublyLinkedList::offsetGet(mixed $index): mixed
} - + \ No newline at end of file diff --git a/tests/php/data/type_rendering_constructorsynopsis_parameters.xml b/tests/php/data/type_rendering_constructorsynopsis_parameters.xml new file mode 100644 index 000000000..e28ae6427 --- /dev/null +++ b/tests/php/data/type_rendering_constructorsynopsis_parameters.xml @@ -0,0 +1,78 @@ + + + +
+ 1. Constructor with no parameters + + final public ClassName::__construct + +
+ +
+ 2. Constructor with one parameter + + final private ClassName::__construct + mixedanything + +
+ +
+ 3. Constructor with one parameter with whitespace in type tag + + abstract ClassName::__construct + bool yesOrNo + +
+ +
+ 4. Constructor with optional parameter + + final protected ClassName::__construct + intcount0 + +
+ +
+ 5. Constructor with nullable parameter + + final public ClassName::__construct + floatnullvalue + +
+ +
+ 6. Constructor with nullable optional parameter + + final private ClassName::__construct + stringnulloptions"" + +
+ +
+ 7. Constructor with reference parameter + + final protected ClassName::__construct + arrayreference + +
+ +
+ 8. Constructor with union type parameter + + final public ClassName::__construct + iterableresourcecallablenulloption + +
+ +
+ 9. Constructor with more than three parameters + + final private ClassName::__construct + intcount + stringname + boolisSomething + arraylist + +
+ +
diff --git a/tests/php/data/type_rendering_methodsynopsis_parameters.xml b/tests/php/data/type_rendering_methodsynopsis_parameters.xml new file mode 100644 index 000000000..00899c617 --- /dev/null +++ b/tests/php/data/type_rendering_methodsynopsis_parameters.xml @@ -0,0 +1,78 @@ + + + +
+ 1. Function/method with no parameters + + function_name + +
+ +
+ 2. Function/method with one parameter + + function_name + mixedanything + +
+ +
+ 3. Function/method with one parameter with whitespace in type tag + + function_name + bool yesOrNo + +
+ +
+ 4. Function/method with optional parameter + + function_name + intcount0 + +
+ +
+ 5. Function/method with nullable parameter + + function_name + floatnullvalue + +
+ +
+ 6. Function/method with nullable optional parameter + + function_name + stringnulloptions"" + +
+ +
+ 7. Function/method with reference parameter + + function_name + arrayreference + +
+ +
+ 8. Function/method with union type parameter + + function_name + iterableresourcecallablenulloption + +
+ +
+ 9. Function/method with more than three parameters + + function_name + intcount + stringname + boolisSomething + arraylist + +
+ +
diff --git a/tests/php/data/type_rendering_methodsynopsis_return_types.xml b/tests/php/data/type_rendering_methodsynopsis_return_types.xml new file mode 100644 index 000000000..cb39f3601 --- /dev/null +++ b/tests/php/data/type_rendering_methodsynopsis_return_types.xml @@ -0,0 +1,74 @@ + + + +
+ 1. Function/method with no return type + + function_name + +
+ +
+ 2. Function/method with one return type - never + + neverfunction_name + +
+ +
+ 3. Function/method with one return type - void + + voidfunction_name + +
+ +
+ 4. Function/method with one return type - mixed + + mixedfunction_name + +
+ +
+ 5. Function/method with one return type with whitespace in type tag + + bool function_name + +
+ +
+ 6. Function/method with union return type + + intfloatfalsefunction_name + +
+ +
+ 7. Function/method with nullable return type + + objectnullfunction_name + +
+ +
+ 8. Function/method with nullable union return type + + stringarrayresourcecallableiterabletruenullfunction_name + +
+ +
+ 9. Function/method with unknown return type + + UnknownTypefunction_name + +
+ +
diff --git a/tests/php/type_rendering_001.phpt b/tests/php/type_rendering_001.phpt new file mode 100644 index 000000000..c1081d4c1 --- /dev/null +++ b/tests/php/type_rendering_001.phpt @@ -0,0 +1,94 @@ +--TEST-- +Type rendering 001 - Methodsynopsis return types +--FILE-- + true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); + +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); + +$render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + +$render->run(); +?> +--EXPECT-- +Filename: type-rendering-methodsynopsis-return-types.html +Content: +
+ +
+

1. Function/method with no return type

+
+ function_name()
+ +
+ +
+

2. Function/method with one return type - never

+
function_name(): never
+ +
+ +
+

3. Function/method with one return type - void

+
function_name(): void
+ +
+ +
+

4. Function/method with one return type - mixed

+
function_name(): mixed
+ +
+ +
+

5. Function/method with one return type with whitespace in type tag

+
function_name(): bool
+ +
+ +
+

6. Function/method with union return type

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

7. Function/method with nullable return type

+
function_name(): ?object
+ +
+ +
+

8. Function/method with nullable union return type

+ + +
+ +
+

9. Function/method with unknown return type

+
function_name(): UnknownType
+ +
+ +
diff --git a/tests/php/type_rendering_002.phpt b/tests/php/type_rendering_002.phpt new file mode 100644 index 000000000..e729f5496 --- /dev/null +++ b/tests/php/type_rendering_002.phpt @@ -0,0 +1,94 @@ +--TEST-- +Type rendering 002 - Methodsynopsis parameters and parameter types +--FILE-- + true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); + +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); + +$render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + +$render->run(); +?> +--EXPECT-- +Filename: type-rendering-methodsynopsis-parameters.html +Content: +
+ +
+

1. Function/method with no parameters

+
+ function_name()
+ +
+ +
+

2. Function/method with one parameter

+
function_name(mixed $anything)
+ +
+ +
+

3. Function/method with one parameter with whitespace in type tag

+
function_name(bool $yesOrNo)
+ +
+ +
+

4. Function/method with optional parameter

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

5. Function/method with nullable parameter

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

6. Function/method with nullable optional parameter

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

7. Function/method with reference parameter

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

8. Function/method with union type parameter

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

9. Function/method with more than three parameters

+
function_name(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)
+ +
+ +
diff --git a/tests/php/type_rendering_003.phpt b/tests/php/type_rendering_003.phpt new file mode 100644 index 000000000..e2bbaa223 --- /dev/null +++ b/tests/php/type_rendering_003.phpt @@ -0,0 +1,94 @@ +--TEST-- +Type rendering 003 - Constructorsynopsis parameters and parameter types +--FILE-- + true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); + +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); + +$render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + +$render->run(); +?> +--EXPECT-- +Filename: type-rendering-constructorsynopsis-parameters.html +Content: +
+ +
+

1. Constructor with no parameters

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

2. Constructor with one parameter

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

3. Constructor with one parameter with whitespace in type tag

+
abstract ClassName::__construct(bool $yesOrNo)
+ +
+ +
+

4. Constructor with optional parameter

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

5. Constructor with nullable parameter

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

6. Constructor with nullable optional parameter

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

7. Constructor with reference parameter

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

8. Constructor with union type parameter

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

9. Constructor with more than three parameters

+
final private ClassName::__construct(
    int $count,
    string $name,
    bool $isSomething,
    array $list
)
+ +
+ +
From 0ee036436453dd05626e7bd3e7845dfa321f758e Mon Sep 17 00:00:00 2001 From: haszi Date: Mon, 12 Feb 2024 14:44:17 +0100 Subject: [PATCH 2/7] Add support for void element Add proper support for void element and add a test case to the approriate files. --- phpdotnet/phd/Package/PHP/XHTML.php | 1 + tests/php/bug49102-1.phpt | 14 +++++---- ...orsynopsis_parameters-and-return-type.xml} | 28 ++++++++++------- ..._rendering_methodsynopsis_return_types.xml | 22 +++++++++----- tests/php/type_rendering_001.phpt | 18 +++++++---- tests/php/type_rendering_003.phpt | 30 +++++++++++-------- 6 files changed, 72 insertions(+), 41 deletions(-) rename tests/php/data/{type_rendering_constructorsynopsis_parameters.xml => type_rendering_constructorsynopsis_parameters-and-return-type.xml} (76%) diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index a4749e212..90c1c1c73 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -667,6 +667,7 @@ public function format_type_text($type, $tagname) { public function format_void($open, $name, $attrs, $props) { if (isset($props['sibling']) && $props['sibling'] == 'methodname') { + $this->cchunk["methodsynopsis"]["returntypes"][] = "void"; return ''; } return parent::format_void($open, $name, $attrs, $props); diff --git a/tests/php/bug49102-1.phpt b/tests/php/bug49102-1.phpt index 273f03dbb..e489ded72 100644 --- a/tests/php/bug49102-1.phpt +++ b/tests/php/bug49102-1.phpt @@ -63,19 +63,19 @@ Content:
/* Methods */
- __construct()
+ __construct(): void
setIteratorMode(int $mode): void
/* Inherited methods */
-
SplDoublyLinkedList::bottom(): mixed
+
SplDoublyLinkedList::bottom(): mixedvoid
-
SplDoublyLinkedList::count(): int
+
SplDoublyLinkedList::count(): intvoid
-
SplDoublyLinkedList::current(): mixed
+
SplDoublyLinkedList::current(): mixedvoid
-
SplDoublyLinkedList::getIteratorMode(): int
+
SplDoublyLinkedList::getIteratorMode(): intvoid
SplDoublyLinkedList::offsetExists(mixed $index): bool
@@ -85,4 +85,6 @@ Content: - \ No newline at end of file + + + diff --git a/tests/php/data/type_rendering_constructorsynopsis_parameters.xml b/tests/php/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml similarity index 76% rename from tests/php/data/type_rendering_constructorsynopsis_parameters.xml rename to tests/php/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml index e28ae6427..318d2a84d 100644 --- a/tests/php/data/type_rendering_constructorsynopsis_parameters.xml +++ b/tests/php/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml @@ -1,15 +1,23 @@ - +
- 1. Constructor with no parameters + 1. Constructor with no parameters, no return type final public ClassName::__construct
- 2. Constructor with one parameter + 2. Constructor with no parameters, void (element) return type + + final public ClassName::__construct + + +
+ +
+ 3. Constructor with one parameter final private ClassName::__construct mixedanything @@ -17,7 +25,7 @@
- 3. Constructor with one parameter with whitespace in type tag + 4. Constructor with one parameter with whitespace in type tag abstract ClassName::__construct bool yesOrNo @@ -25,7 +33,7 @@
- 4. Constructor with optional parameter + 5. Constructor with optional parameter final protected ClassName::__construct intcount0 @@ -33,7 +41,7 @@
- 5. Constructor with nullable parameter + 6. Constructor with nullable parameter final public ClassName::__construct floatnullvalue @@ -41,7 +49,7 @@
- 6. Constructor with nullable optional parameter + 7. Constructor with nullable optional parameter final private ClassName::__construct stringnulloptions"" @@ -49,7 +57,7 @@
- 7. Constructor with reference parameter + 8. Constructor with reference parameter final protected ClassName::__construct arrayreference @@ -57,7 +65,7 @@
- 8. Constructor with union type parameter + 9. Constructor with union type parameter final public ClassName::__construct iterableresourcecallablenulloption @@ -65,7 +73,7 @@
- 9. Constructor with more than three parameters + 10. Constructor with more than three parameters final private ClassName::__construct intcount diff --git a/tests/php/data/type_rendering_methodsynopsis_return_types.xml b/tests/php/data/type_rendering_methodsynopsis_return_types.xml index cb39f3601..57cbe7605 100644 --- a/tests/php/data/type_rendering_methodsynopsis_return_types.xml +++ b/tests/php/data/type_rendering_methodsynopsis_return_types.xml @@ -23,49 +23,57 @@
- 4. Function/method with one return type - mixed + 4. Function/method with one return type - void element + + function_name + + +
+ +
+ 5. Function/method with one return type - mixed mixedfunction_name
- 5. Function/method with one return type with whitespace in type tag + 6. Function/method with one return type with whitespace in type tag bool function_name
- 6. Function/method with union return type + 7. Function/method with union return type intfloatfalsefunction_name
- 7. Function/method with nullable return type + 8. Function/method with nullable return type objectnullfunction_name
- 8. Function/method with nullable union return type + 9. Function/method with nullable union return type stringarrayresourcecallableiterabletruenullfunction_name
- 9. Function/method with unknown return type + 10. Function/method with unknown return type UnknownTypefunction_name