Skip to content

Commit a41a31f

Browse files
Christoph Harms-Ensinkjaapio
authored andcommitted
UPDATE Method.php, MethodTest.php
- try to make the if-condition php 7.2.0-compatible - correct docBlock for the test method
1 parent e9454d8 commit a41a31f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/DocBlock/Tags/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static function create(
128128
$returnType = $typeResolver->resolve($returnType, $context);
129129
$description = $descriptionFactory->create($description, $context);
130130

131-
if ('' !== $arguments) {
131+
if (is_string($arguments) && strlen($arguments) > 0) {
132132
$arguments = explode(',', $arguments);
133133
foreach($arguments as &$argument) {
134134
$argument = explode(' ', self::stripRestArg(trim($argument)), 2);

tests/unit/DocBlock/Tags/MethodTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ public function testFactoryMethod()
277277
$this->assertSame($description, $fixture->getDescription());
278278
}
279279

280+
/**
281+
* @covers ::create
282+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::<public>
283+
* @uses \phpDocumentor\Reflection\TypeResolver
284+
* @uses \phpDocumentor\Reflection\DocBlock\Description
285+
* @uses \phpDocumentor\Reflection\Types\Context
286+
*/
280287
public function testReturnTypeThis()
281288
{
282289
$descriptionFactory = m::mock(DescriptionFactory::class);

0 commit comments

Comments
 (0)