Skip to content

Commit d08bc1c

Browse files
committed
added false and true to the php types, alias for boolean
1 parent bff4cbd commit d08bc1c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

renderers/BaseRenderer.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,21 @@ public function createTypeLink($types, $context = null, $title = null, $options
112112
'object',
113113
'resource',
114114
'null',
115+
'false',
116+
'true',
117+
];
118+
$phpTypeAliases = [
119+
'true' => 'boolean',
120+
'false' => 'boolean',
115121
];
116122
// check if it is PHP internal class
117123
if (((class_exists($type, false) || interface_exists($type, false) || trait_exists($type, false)) &&
118124
($reflection = new \ReflectionClass($type)) && $reflection->isInternal())) {
119125
$links[] = $this->generateLink($linkText, 'http://www.php.net/class.' . strtolower(ltrim($type, '\\')), $options) . $postfix;
120126
} elseif (in_array($type, $phpTypes)) {
127+
if (isset($phpTypeAliases[$type])) {
128+
$type = $phpTypeAliases[$type];
129+
}
121130
$links[] = $this->generateLink($linkText, 'http://www.php.net/language.types.' . strtolower(ltrim($type, '\\')), $options) . $postfix;
122131
} else {
123132
$links[] = $type;

templates/html/ApiRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function renderMethodSignature($method, $context = null)
280280
. '<span class="signature-type">' . ($method->isReturnByReference ? '<b>&</b>' : '')
281281
. ($method->returnType === null ? 'void' : $this->createTypeLink($method->returnTypes, $context)) . '</span> '
282282
. '<strong>' . $this->createSubjectLink($method, $method->name) . '</strong>'
283-
. str_replace(' ', ' ', '( ' . implode(', ', $params) . ' )');
283+
. str_replace(' ', ' ', ' ( ' . implode(', ', $params) . ' )');
284284
}
285285

286286
/**

0 commit comments

Comments
 (0)