Skip to content

Commit 7a561be

Browse files
authored
Update XML class reference and improve type hinting in function signatures (#252)
1 parent b6f7bac commit 7a561be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/docgen/class.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<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">
2+
<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">
33
<title>The {CLASS_NAME} {CLASS_TYPE}</title>
44
<titleabbrev>{CLASS_NAME}</titleabbrev>
55

@@ -47,7 +47,7 @@
4747

4848
&reference.{EXT_NAME_ID}.entities.{CLASS_NAME_ID};
4949

50-
</phpdoc:classref>
50+
</reference>
5151
<!-- Keep this comment at the end of the file
5252
Local variables:
5353
mode: sgml

scripts/docgen/docgen.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function usage() { /* {{{ */
9090
}
9191
/* }}} */
9292

93-
function find_function($ext, ReflectionMethod $method = NULL, ReflectionFunction $func = NULL) { /* {{{ */
93+
function find_function($ext, ?ReflectionMethod $method = NULL, ?ReflectionFunction $func = NULL) { /* {{{ */
9494
$ext_name = strtolower($ext);
9595
$ext = new ReflectionExtension($ext);
9696

@@ -224,7 +224,7 @@ function get_type_by_string($str) { /* {{{ */
224224
/* }}} */
225225

226226
/** @return string|null */
227-
function get_type_as_xml_string(ReflectionType $type = null) { /* {{{ */
227+
function get_type_as_xml_string(?ReflectionType $type = null) { /* {{{ */
228228
if ($type instanceof ReflectionNamedType) {
229229
$ret = "<type>{$type->getName()}</type>";
230230
if ($type->allowsNull()) {

0 commit comments

Comments
 (0)