Skip to content

Commit 94bebce

Browse files
committed
include information about static and abstract in api doc
fixes #10
1 parent 3a69b8b commit 94bebce

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

templates/bootstrap/assets/css/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ table.summary-table .col-defined { width: 15%; }
9191
margin-bottom: 0;
9292
}
9393

94+
.signature-defs {
95+
color: #936;
96+
}
97+
98+
.signature-type, .signature-type a {
99+
color: #693;
100+
}
101+
94102
.tool-link {
95103
float: right;
96104
color: #ddd;

templates/html/ApiRenderer.php

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,16 @@ public function renderPropertySignature($property, $context = null)
238238
return implode('<br />', $sig);
239239
}
240240

241-
return $this->createTypeLink($property->types, $context) . ' ' . $this->createSubjectLink($property, $property->name) . ' '
242-
. ApiMarkdown::highlight('= ' . ($property->defaultValue === null ? 'null' : $property->defaultValue), 'php');
241+
$definition = [];
242+
$definition[] = $property->visibility;
243+
if ($property->isStatic) {
244+
$definition[] = 'static';
245+
}
246+
247+
return '<span class="signature-defs">' . implode(' ', $definition) . '</span> '
248+
. '<span class="signature-type">' . $this->createTypeLink($property->types, $context) . '</span>'
249+
. ' ' . $this->createSubjectLink($property, $property->name) . ' '
250+
. ApiMarkdown::highlight('= ' . ($property->defaultValue === null ? 'null' : $property->defaultValue), 'php');
243251
}
244252

245253
/**
@@ -256,9 +264,19 @@ public function renderMethodSignature($method, $context = null)
256264
. ($param->isOptional ? ' = ' . $param->defaultValue : '');
257265
}
258266

259-
return ($method->isReturnByReference ? '<b>&</b>' : '')
260-
. ($method->returnType === null ? 'void' : $this->createTypeLink($method->returnTypes, $context))
261-
. ' <strong>' . $this->createSubjectLink($method, $method->name) . '</strong>'
267+
$definition = [];
268+
$definition[] = $method->visibility;
269+
if ($method->isAbstract) {
270+
$definition[] = 'abstract';
271+
}
272+
if ($method->isStatic) {
273+
$definition[] = 'static';
274+
}
275+
276+
return '<span class="signature-defs">' . implode(' ', $definition) . '</span> '
277+
. '<span class="signature-type">' . ($method->isReturnByReference ? '<b>&</b>' : '')
278+
. ($method->returnType === null ? 'void' : $this->createTypeLink($method->returnTypes, $context)) . '</span> '
279+
. '<strong>' . $this->createSubjectLink($method, $method->name) . '</strong>'
262280
. ApiMarkdown::highlight(str_replace(' ', ' ', '( ' . implode(', ', $params) . ' )'), 'php');
263281
}
264282

templates/html/views/methodDetails.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
<?= $method->name ?>()
3838
<span class="detail-header-tag small">
3939
<?= $method->visibility ?>
40+
<?= $method->isAbstract ? 'abstract' : '' ?>
41+
<?= $method->isStatic ? 'static' : '' ?>
4042
method
4143
<?php if (!empty($method->since)): ?>
4244
(available since version <?= $method->since ?>)

templates/html/views/propertyDetails.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<?= $property->name ?>
3838
<span class="detail-header-tag small">
3939
<?= $property->visibility ?>
40+
<?= $property->isStatic ? 'static' : '' ?>
4041
<?php if ($property->getIsReadOnly()) echo ' <em>read-only</em> '; ?>
4142
<?php if ($property->getIsWriteOnly()) echo ' <em>write-only</em> '; ?>
4243
property

0 commit comments

Comments
 (0)