Skip to content

Commit

Permalink
Fix bug with docblock without @
Browse files Browse the repository at this point in the history
  • Loading branch information
bzick committed Sep 14, 2017
1 parent ecaf2a9 commit 108e21f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Koda/ParseKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public static function parseDocBlock(string $doc)
}
}
}
} else {
$parsed["desc"] = [$doc];
}

return $parsed;
Expand Down
10 changes: 10 additions & 0 deletions tests/MethodInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
class MethodInfoTest extends TestCase
{

/**
* @group dev
*/
public function testEmptyParams()
{
$method = new MethodInfo(new ClassInfo(Samples::class));
$method->import("noParams");

$this->assertSame("No one parameter", $method->getDescription());
}

public function testParse()
{
Expand Down
8 changes: 8 additions & 0 deletions tests/Samples.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
class Samples
{

/**
* No one parameter
*/
public static function noParams()
{

}

/**
* @param int $val
*
Expand Down

0 comments on commit 108e21f

Please sign in to comment.