Skip to content

Commit c6f6e2d

Browse files
committed
Improve naming for tag factory
1 parent ece4f5a commit c6f6e2d

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

src/DocBlock/DescriptionFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace phpDocumentor\Reflection\DocBlock;
1515

16+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory;
1617
use phpDocumentor\Reflection\Types\Context as TypeContext;
1718
use phpDocumentor\Reflection\Utils;
1819

@@ -47,13 +48,13 @@
4748
*/
4849
class DescriptionFactory
4950
{
50-
/** @var SimpleTagFactory */
51+
/** @var Factory */
5152
private $tagFactory;
5253

5354
/**
5455
* Initializes this factory with the means to construct (inline) tags.
5556
*/
56-
public function __construct(SimpleTagFactory $tagFactory)
57+
public function __construct(Factory $tagFactory)
5758
{
5859
$this->tagFactory = $tagFactory;
5960
}

src/DocBlock/StandardTagFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use phpDocumentor\Reflection\DocBlock\Tags\Author;
1818
use phpDocumentor\Reflection\DocBlock\Tags\Covers;
1919
use phpDocumentor\Reflection\DocBlock\Tags\Deprecated;
20+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory;
2021
use phpDocumentor\Reflection\DocBlock\Tags\Generic;
2122
use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
2223
use phpDocumentor\Reflection\DocBlock\Tags\Link as LinkTag;
@@ -233,7 +234,7 @@ private function createTag(string $body, string $name, TypeContext $context): Ta
233234
/**
234235
* Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`).
235236
*
236-
* @return class-string<Tag>|SimpleTagFactory
237+
* @return class-string<Tag>|Factory
237238
*/
238239
private function findHandlerClassName(string $tagName, TypeContext $context)
239240
{
@@ -297,7 +298,7 @@ private function getArgumentsForParametersFromWiring(array $parameters, array $l
297298
* Retrieves a series of ReflectionParameter objects for the static 'create' method of the given
298299
* tag handler class name.
299300
*
300-
* @param class-string|SimpleTagFactory $handler
301+
* @param class-string|Factory $handler
301302
*
302303
* @return ReflectionParameter[]
303304
*/

src/DocBlock/TagFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
namespace phpDocumentor\Reflection\DocBlock;
1515

1616
use InvalidArgumentException;
17+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory;
1718
use phpDocumentor\Reflection\Types\Context as TypeContext;
1819

19-
interface TagFactory extends SimpleTagFactory
20+
interface TagFactory extends Factory
2021
{
2122
/**
2223
* Adds a parameter to the service locator that can be injected in a tag's factory method.

src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
1515

16-
use phpDocumentor\Reflection\DocBlock\SimpleTagFactory;
16+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory;
1717
use phpDocumentor\Reflection\DocBlock\Tag;
1818
use phpDocumentor\Reflection\DocBlock\TagFactory;
1919
use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
@@ -32,7 +32,7 @@
3232
*
3333
* @internal This class is not part of the BC promise of this library.
3434
*/
35-
class AbstractPHPStanFactory implements SimpleTagFactory
35+
class AbstractPHPStanFactory implements Factory
3636
{
3737
private PhpDocParser $parser;
3838
private Lexer $lexer;

src/DocBlock/SimpleTagFactory.php renamed to src/DocBlock/Tags/Factory/Factory.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
<?php
2+
/*
3+
* This file is part of phpDocumentor.
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @link http://phpdoc.org
9+
*
10+
*/
211

312
declare(strict_types=1);
413

@@ -11,12 +20,13 @@
1120
* @link http://phpdoc.org
1221
*/
1322

14-
namespace phpDocumentor\Reflection\DocBlock;
23+
namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
1524

1625
use InvalidArgumentException;
26+
use phpDocumentor\Reflection\DocBlock\Tag;
1727
use phpDocumentor\Reflection\Types\Context as TypeContext;
1828

19-
interface SimpleTagFactory
29+
interface Factory
2030
{
2131

2232
/**

src/DocBlockFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use InvalidArgumentException;
1717
use LogicException;
1818
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
19-
use phpDocumentor\Reflection\DocBlock\SimpleTagFactory;
19+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory;
2020
use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
2121
use phpDocumentor\Reflection\DocBlock\Tag;
2222
use phpDocumentor\Reflection\DocBlock\TagFactory;
@@ -42,13 +42,13 @@ final class DocBlockFactory implements DocBlockFactoryInterface
4242
/** @var DocBlock\DescriptionFactory */
4343
private $descriptionFactory;
4444

45-
/** @var DocBlock\SimpleTagFactory */
45+
/** @var \phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory */
4646
private $tagFactory;
4747

4848
/**
4949
* Initializes this factory with the required subcontractors.
5050
*/
51-
public function __construct(DescriptionFactory $descriptionFactory, SimpleTagFactory $tagFactory)
51+
public function __construct(DescriptionFactory $descriptionFactory, Factory $tagFactory)
5252
{
5353
$this->descriptionFactory = $descriptionFactory;
5454
$this->tagFactory = $tagFactory;

0 commit comments

Comments
 (0)