Skip to content

Commit e1b5782

Browse files
committed
fix PHP Notice: Undefined property: stdClass::... during render view
1 parent 29db5f3 commit e1b5782

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/ClassParser.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,32 @@ private function getMethodDetails($method)
5656
{
5757
$docblock = $this->docBlockFactory->create($method->getDocComment() ?: '/** */');
5858

59+
$data = [
60+
'shortDescription' => null,
61+
'longDescription' => null,
62+
'argumentsList' => [],
63+
'argumentsDescription' => null,
64+
'returnValue' => null,
65+
'throwsExceptions' => null,
66+
'visibility' => null,
67+
];
68+
5969
if ($docblock->getSummary()) {
60-
$data = [
61-
'shortDescription' => $docblock->getSummary(),
62-
'longDescription' => $docblock->getDescription(),
63-
'argumentsList' => $this->retrieveParams($docblock->getTagsByName('param')),
64-
'argumentsDescription' => $this->retrieveParamsDescription($docblock->getTagsByName('param')),
65-
'returnValue' => $this->retrieveTagData($docblock->getTagsByName('return')),
66-
'throwsExceptions' => $this->retrieveTagData($docblock->getTagsByName('throws')),
67-
'visibility' => join(
70+
$data['shortDescription'] = $docblock->getSummary();
71+
$data['longDescription'] = $docblock->getDescription();
72+
$data['argumentsList'] = $this->retrieveParams($docblock->getTagsByName('param'));
73+
$data['argumentsDescription'] = $this->retrieveParamsDescription($docblock->getTagsByName('param'));
74+
$data['returnValue'] = $this->retrieveTagData($docblock->getTagsByName('return'));
75+
$data['throwsExceptions'] = $this->retrieveTagData($docblock->getTagsByName('throws'));
76+
$data['visibility'] = join(
6877
'',
6978
[
7079
$method->isFinal() ? 'final ' : '',
7180
'public',
7281
$method->isStatic() ? ' static' : '',
7382
]
74-
),
75-
];
83+
);
7684
} else {
77-
$data = [];
7885
$className = sprintf("%s::%s", $method->class, $method->name);
7986
$atlasdoc = new \Clean\PhpAtlas\ClassMethod($className);
8087
$data['shortDescription'] = $atlasdoc->getMethodShortDescription();

0 commit comments

Comments
 (0)