[DOC-CVS] [doc-base] master: Update XML class reference and improve type hinting in function signatures (#252)
[email protected] (Luffy via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Luffy (sy-records)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2025-09-27T12:18:42+01:00
Commit: https://github.com/php/doc-base/commit/7a561bef14a2317485d236b755907ee526272bff
Raw diff: https://github.com/php/doc-base/commit/7a561bef14a2317485d236b755907ee526272bff.diff
Update XML class reference and improve type hinting in function signatures (#252)
Changed paths:
M scripts/docgen/class.tpl
M scripts/docgen/docgen.php
Diff:
diff --git a/scripts/docgen/class.tpl b/scripts/docgen/class.tpl
index 0eb2486b6..ee0dc1420 100644
--- a/scripts/docgen/class.tpl
+++ b/scripts/docgen/class.tpl
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<phpdoc:classref xml:id="class.{CLASS_NAME_ID}" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
+<reference role="{CLASS_TYPE}" xml:id="class.{CLASS_NAME_ID}" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The {CLASS_NAME} {CLASS_TYPE}</title>
<titleabbrev>{CLASS_NAME}</titleabbrev>
@@ -47,7 +47,7 @@
&reference.{EXT_NAME_ID}.entities.{CLASS_NAME_ID};
-</phpdoc:classref>
+</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
diff --git a/scripts/docgen/docgen.php b/scripts/docgen/docgen.php
index 928d3a5c1..09fdf9b80 100644
--- a/scripts/docgen/docgen.php
+++ b/scripts/docgen/docgen.php
@@ -90,7 +90,7 @@ function usage() { /* {{{ */
}
/* }}} */
-function find_function($ext, ReflectionMethod $method = NULL, ReflectionFunction $func = NULL) { /* {{{ */
+function find_function($ext, ?ReflectionMethod $method = NULL, ?ReflectionFunction $func = NULL) { /* {{{ */
$ext_name = strtolower($ext);
$ext = new ReflectionExtension($ext);
@@ -224,7 +224,7 @@ function get_type_by_string($str) { /* {{{ */
/* }}} */
/** @return string|null */
-function get_type_as_xml_string(ReflectionType $type = null) { /* {{{ */
+function get_type_as_xml_string(?ReflectionType $type = null) { /* {{{ */
if ($type instanceof ReflectionNamedType) {
$ret = "<type>{$type->getName()}</type>";
if ($type->allowsNull()) {