Skip to content
This repository was archived by the owner on Dec 29, 2020. It is now read-only.

Commit 3d8879b

Browse files
committed
Merge pull request #5 from meyerbaptiste/fix-parent-fqsen
Avoid exception when superclass is null and no docblock is provided for a method
2 parents 4d220b8 + 98f7f7d commit 3d8879b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/Converter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private function getDocBlock(Project $project, int $objectType, string $namespac
284284
}
285285

286286
$parentFqsen = $obj->getParent();
287-
if (!$parent = $this->getObject($project, $parentFqsen, self::OBJECT_CLASS)) {
287+
if (null === $parentFqsen || !$parent = $this->getObject($project, $parentFqsen, self::OBJECT_CLASS)) {
288288
return;
289289
}
290290

tests/Fixtures/Foo.php

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*/
88
class Foo
99
{
10+
public function bar($foo)
11+
{
12+
}
13+
1014
/**
1115
* @param float $a
1216
*/

tests/test.php

+4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ function test(string $a = null)
120120
*/
121121
class Foo
122122
{
123+
public function bar($foo)
124+
{
125+
}
126+
123127
/**
124128
* @param float $a
125129
*/

0 commit comments

Comments
 (0)