Skip to content

Commit 8ce16ff

Browse files
committed
Use DocFactoryProvider::getDocFactory() instead
1 parent f3439a5 commit 8ce16ff

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

src/voku/SimplePhpParser/Model/PHPClass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PhpParser\Comment\Doc;
99
use PhpParser\Node\Stmt\Class_;
1010
use ReflectionClass;
11+
use voku\SimplePhpParser\Parsers\Helper\DocFactoryProvider;
1112
use voku\SimplePhpParser\Parsers\Helper\Utils;
1213

1314
class PHPClass extends BasePHPClass
@@ -386,7 +387,7 @@ private function readPhpDocProperties($doc): void
386387
}
387388

388389
try {
389-
$phpDoc = DocBlockFactory::createInstance()->create($docComment);
390+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment);
390391

391392
$parsedPropertyTags = $phpDoc->getTagsByName('property')
392393
+ $phpDoc->getTagsByName('property-read')

src/voku/SimplePhpParser/Model/PHPFunction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function readObjectFromPhpNode($node, $dummy = null): self
7777
$docComment = $node->getDocComment();
7878
if ($docComment) {
7979
try {
80-
$phpDoc = DocBlockFactory::createInstance()->create($docComment->getText());
80+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment->getText());
8181
$this->summary = $phpDoc->getSummary();
8282
$this->description = (string) $phpDoc->getDescription();
8383
} catch (\Exception $e) {
@@ -230,7 +230,7 @@ protected function readPhpDoc($doc): void
230230
}
231231

232232
try {
233-
$phpDoc = DocBlockFactory::createInstance()->create($docComment);
233+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment);
234234

235235
$parsedReturnTag = $phpDoc->getTagsByName('return');
236236

src/voku/SimplePhpParser/Model/PHPMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function readObjectFromPhpNode($node, $classStr = null): PHPFunction
4545
$docComment = $node->getDocComment();
4646
if ($docComment) {
4747
try {
48-
$phpDoc = DocBlockFactory::createInstance()->create($docComment->getText());
48+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment->getText());
4949
$this->summary = $phpDoc->getSummary();
5050
$this->description = (string) $phpDoc->getDescription();
5151
} catch (\Exception $e) {

src/voku/SimplePhpParser/Model/PHPParameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function readPhpDoc($doc, string $parameterName): void
221221
}
222222

223223
try {
224-
$phpDoc = DocBlockFactory::createInstance()->create($docComment);
224+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment);
225225

226226
$parsedParamTags = $phpDoc->getTagsByName('param');
227227

src/voku/SimplePhpParser/Model/PHPProperty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private function readPhpDoc($doc): void
230230
}
231231

232232
try {
233-
$phpDoc = DocBlockFactory::createInstance()->create($docComment);
233+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment);
234234

235235
$parsedParamTags = $phpDoc->getTagsByName('var');
236236

src/voku/SimplePhpParser/Model/PHPTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private function readPhpDocProperties($doc): void
293293
}
294294

295295
try {
296-
$phpDoc = DocBlockFactory::createInstance()->create($docComment);
296+
$phpDoc = DocFactoryProvider::getDocFactory()->create($docComment);
297297

298298
$parsedPropertyTags = $phpDoc->getTagsByName('property')
299299
+ $phpDoc->getTagsByName('property-read')

0 commit comments

Comments
 (0)