Skip to content

Commit 9907779

Browse files
committed
feature #1332 Add conditional @implements tag to Doctrine repository template (gremo)
This PR was merged into the 1.0-dev branch. Discussion ---------- Add conditional `@implements` tag to Doctrine repository template Adding the `@implements` phpdoc tag on generated Doctrine repository classes will help IDE and prevent tools like phpstan from generating errors. `@implements` is only added if `$with_password_upgrade` is set to true, avoiding useless phpdocs. ![Immagine 2023-07-06 120413](https://github.com/symfony/maker-bundle/assets/1532616/9e9c1b08-4f60-4a8b-862d-0f32cff2920b) Similar to #1088 Commits ------- dd3208f Add conditional `@implements` tag to Doctrine repository template
2 parents 9d0003b + dd3208f commit 9907779

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Resources/skeleton/doctrine/Repository.tpl.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* @extends ServiceEntityRepository<<?= $entity_class_name; ?>>
9+
<?= $with_password_upgrade ? "* @implements PasswordUpgraderInterface<$entity_class_name>\n" : "" ?>
910
*
1011
* @method <?= $entity_class_name; ?>|null find($id, $lockMode = null, $lockVersion = null)
1112
* @method <?= $entity_class_name; ?>|null findOneBy(array $criteria, array $orderBy = null)

0 commit comments

Comments
 (0)