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

Avoid exception when superclass is null and no docblock is provided for a method #5

Merged
merged 1 commit into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private function getDocBlock(Project $project, int $objectType, string $namespac
}

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

Expand Down
4 changes: 4 additions & 0 deletions tests/Fixtures/Foo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
class Foo
{
public function bar($foo)
{
}

/**
* @param float $a
*/
Expand Down
4 changes: 4 additions & 0 deletions tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ function test(string $a = null)
*/
class Foo
{
public function bar($foo)
{
}

/**
* @param float $a
*/
Expand Down