Skip to content

Commit cb6ec76

Browse files
committed
Adds location to docblock
1 parent 7049808 commit cb6ec76

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/phpDocumentor/Reflection/Php/Factory/DocBlock.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use InvalidArgumentException;
1717
use phpDocumentor\Reflection\DocBlock as DocBlockDescriptor;
1818
use phpDocumentor\Reflection\DocBlockFactoryInterface;
19+
use phpDocumentor\Reflection\Location;
1920
use phpDocumentor\Reflection\Php\ProjectFactoryStrategy;
2021
use phpDocumentor\Reflection\Php\StrategyContainer;
2122
use phpDocumentor\Reflection\Types\Context;
@@ -81,6 +82,6 @@ public function create($object, StrategyContainer $strategies, Context $context
8182
);
8283
}
8384

84-
return $this->docblockFactory->create($object->getText(), $context);
85+
return $this->docblockFactory->create($object->getText(), $context, new Location($object->getLine()));
8586
}
8687
}

tests/unit/phpDocumentor/Reflection/Php/Factory/DocBlockTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function testCreateCallsFactory()
6666

6767
$docMock = m::mock(Doc::class);
6868
$docMock->shouldReceive('getText')->andReturn('');
69+
$docMock->shouldReceive('getLine')->andReturn(1);
6970

7071
$result = $this->fixture->create($docMock, $this->strategiesMock);
7172

0 commit comments

Comments
 (0)