Commit 65d08423 by Alexander Makarov

Safer checks for apidoc renderer

parent 46b553f0
......@@ -71,7 +71,7 @@ abstract class BaseRenderer extends Component
$links = [];
foreach ($types as $type) {
$postfix = '';
if (!is_object($type)) {
if (is_string($type)) {
if (substr_compare($type, '[]', -2, 2) === 0) {
$postfix = '[]';
$type = substr($type, 0, -2);
......@@ -85,7 +85,7 @@ abstract class BaseRenderer extends Component
ltrim($type, '\\');
}
}
if (!is_object($type)) {
if (is_string($type)) {
$linkText = ltrim($type, '\\');
if ($title !== null) {
$linkText = $title;
......@@ -110,7 +110,7 @@ abstract class BaseRenderer extends Component
} else {
$links[] = $type;
}
} else {
} elseif ($type instanceof BaseDoc) {
$linkText = $type->name;
if ($title !== null) {
$linkText = $title;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment