Skip to content

Commit 97e76d4

Browse files
committed
Fix tests
1 parent d43f979 commit 97e76d4

18 files changed

+3
-79
lines changed

phpstan.neon

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,5 @@ parameters:
1717
- 'src/Menu/CaseStudyListUrlProvider.php'
1818

1919
ignoreErrors:
20-
# Replace checkMissingIterableValueType parameter to avoid deprecated warning
21-
-
22-
identifier: missingType.iterableValue
23-
# Replace checkGenericClassInNonGenericObjectType parameter to avoid deprecated warning
24-
#-
25-
# identifier: missingType.generics
20+
- identifier: missingType.iterableValue
21+
- identifier: missingType.generics

src/Entity/Tag.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class Tag implements TagInterface
3535

3636
protected ?int $position = null;
3737

38-
/**
39-
* @var Collection<array-key, ArticleInterface>
40-
*/
4138
protected Collection $articles;
4239

4340
public function __construct()

src/Entity/TagInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,5 @@ public function removeArticle(ArticleInterface $article): void;
3333

3434
public function hasArticle(ArticleInterface $article): bool;
3535

36-
/**
37-
* @return Collection<array-key, ArticleInterface>
38-
*/
3936
public function getArticles(): Collection;
4037
}

src/Factory/ArticleFactory.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@
1616
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
1717
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
1818

19-
/**
20-
* @implements ArticleFactoryInterface<ArticleInterface>
21-
*/
2219
#[AsDecorator(decorates: 'monsieurbiz_blog.factory.article')]
2320
final class ArticleFactory implements ArticleFactoryInterface
2421
{
25-
/**
26-
* @param FactoryInterface<ArticleInterface> $originalArticleFactory
27-
*/
2822
public function __construct(
2923
#[AutowireDecorated]
3024
private readonly FactoryInterface $originalArticleFactory
@@ -33,6 +27,7 @@ public function __construct(
3327

3428
public function createNew(): ArticleInterface
3529
{
30+
/** @var ArticleInterface */
3631
return $this->originalArticleFactory->createNew();
3732
}
3833

src/Factory/ArticleFactoryInterface.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
use MonsieurBiz\SyliusBlogPlugin\Entity\ArticleInterface;
1515
use Sylius\Component\Resource\Factory\FactoryInterface;
1616

17-
/**
18-
* @template T of ArticleInterface
19-
*
20-
* @extends FactoryInterface<T>
21-
*/
2217
interface ArticleFactoryInterface extends FactoryInterface
2318
{
2419
public function createNewWithType(string $type): ArticleInterface;

src/Fixture/Factory/ArticleFixtureFactory.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
use Faker\Generator;
1919
use MonsieurBiz\SyliusBlogPlugin\Entity\ArticleInterface;
2020
use MonsieurBiz\SyliusBlogPlugin\Entity\ArticleTranslationInterface;
21-
use MonsieurBiz\SyliusBlogPlugin\Entity\AuthorInterface;
22-
use MonsieurBiz\SyliusBlogPlugin\Entity\TagInterface;
2321
use MonsieurBiz\SyliusBlogPlugin\Repository\TagRepositoryInterface;
2422
use MonsieurBiz\SyliusMediaManagerPlugin\Exception\CannotReadCurrentFolderException;
2523
use MonsieurBiz\SyliusMediaManagerPlugin\Helper\FileHelperInterface;
@@ -48,13 +46,6 @@ final class ArticleFixtureFactory extends AbstractExampleFactory
4846

4947
/**
5048
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
51-
*
52-
* @param FactoryInterface<ArticleInterface> $articleFactory
53-
* @param FactoryInterface<ArticleTranslationInterface> $articleTranslationFactory
54-
* @param TagRepositoryInterface<TagInterface> $tagRepository
55-
* @param RepositoryInterface<LocaleInterface> $localeRepository
56-
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
57-
* @param RepositoryInterface<AuthorInterface> $authorRepository
5849
*/
5950
public function __construct(
6051
private FactoryInterface $articleFactory,

src/Fixture/Factory/AuthorFixtureFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ final class AuthorFixtureFactory extends AbstractExampleFactory
3131

3232
private Generator $faker;
3333

34-
/**
35-
* @param FactoryInterface<AuthorInterface> $authorFactory
36-
*/
3734
public function __construct(
3835
private FactoryInterface $authorFactory,
3936
private FileLocatorInterface $fileLocator,

src/Fixture/Factory/TagFixtureFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ final class TagFixtureFactory extends AbstractExampleFactory
3131

3232
private Generator $faker;
3333

34-
/**
35-
* @param FactoryInterface<TagInterface> $tagFactory
36-
* @param FactoryInterface<TagTranslationInterface> $tagTranslationFactory
37-
* @param RepositoryInterface<LocaleInterface> $localeRepository
38-
*/
3934
public function __construct(
4035
private FactoryInterface $tagFactory,
4136
private FactoryInterface $tagTranslationFactory,

src/Form/Type/ArticleType.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace MonsieurBiz\SyliusBlogPlugin\Form\Type;
1313

14-
use MonsieurBiz\SyliusBlogPlugin\Entity\AuthorInterface;
1514
use MonsieurBiz\SyliusBlogPlugin\Entity\Tag;
1615
use MonsieurBiz\SyliusBlogPlugin\Entity\TagInterface;
1716
use MonsieurBiz\SyliusBlogPlugin\Repository\AuthorRepositoryInterface;
@@ -30,9 +29,6 @@
3029

3130
final class ArticleType extends AbstractResourceType
3231
{
33-
/**
34-
* @param AuthorRepositoryInterface<AuthorInterface> $authorRepository
35-
*/
3632
public function __construct(
3733
private LocaleContextInterface $localeContext,
3834
private AuthorRepositoryInterface $authorRepository,

src/Form/Type/CaseStudyElementType.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
final class CaseStudyElementType extends AbstractType
2828
{
29-
/** @phpstan-ignore-next-line */
3029
public function __construct(
3130
private ArticleRepositoryInterface $articleRepository,
3231
private ChannelContextInterface $channelContext,

0 commit comments

Comments
 (0)