Remove abstract factory

This commit is contained in:
Jaapio
2024-08-14 21:57:29 +02:00
parent 06e5db2279
commit 3f5534f776
4 changed files with 4 additions and 22 deletions
@@ -1,19 +0,0 @@
<?php
declare(strict_types=1);
namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context;
use PHPStan\PhpDocParser\Ast\PhpDoc\ImplementsTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
/**
* @internal This class is not part of the BC promise of this library.
*/
abstract class AbstractImplementsFactory implements PHPStanFactory
{
}
@@ -18,7 +18,7 @@ use function is_string;
/** /**
* @internal This class is not part of the BC promise of this library. * @internal This class is not part of the BC promise of this library.
*/ */
final class ImplementsFactory extends AbstractImplementsFactory final class ImplementsFactory implements Factory
{ {
private DescriptionFactory $descriptionFactory; private DescriptionFactory $descriptionFactory;
private TypeResolver $typeResolver; private TypeResolver $typeResolver;
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
use InvalidArgumentException;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tags\Template; use phpDocumentor\Reflection\DocBlock\Tags\Template;
@@ -36,7 +37,7 @@ final class TemplateFactory implements PHPStanFactory
Assert::isInstanceOf($tagValue, TemplateTagValueNode::class); Assert::isInstanceOf($tagValue, TemplateTagValueNode::class);
$name = $tagValue->name; $name = $tagValue->name;
if ($name === '') { if ($name === '') {
throw new \InvalidArgumentException('Template name cannot be empty'); throw new InvalidArgumentException('Template name cannot be empty');
} }
$description = $tagValue->getAttribute('description'); $description = $tagValue->getAttribute('description');
@@ -18,7 +18,7 @@ use function is_string;
/** /**
* @internal This class is not part of the BC promise of this library. * @internal This class is not part of the BC promise of this library.
*/ */
final class TemplateImplementsFactory extends AbstractImplementsFactory final class TemplateImplementsFactory implements Factory
{ {
private DescriptionFactory $descriptionFactory; private DescriptionFactory $descriptionFactory;
private TypeResolver $typeResolver; private TypeResolver $typeResolver;