Skip to content

Commit

Permalink
feature #1332 Add conditional @implements tag to Doctrine repositor…
Browse files Browse the repository at this point in the history
…y 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
  • Loading branch information
weaverryan committed Jul 10, 2023
2 parents 9d0003b + dd3208f commit 9907779
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Resources/skeleton/doctrine/Repository.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* @extends ServiceEntityRepository<<?= $entity_class_name; ?>>
<?= $with_password_upgrade ? "* @implements PasswordUpgraderInterface<$entity_class_name>\n" : "" ?>
*
* @method <?= $entity_class_name; ?>|null find($id, $lockMode = null, $lockVersion = null)
* @method <?= $entity_class_name; ?>|null findOneBy(array $criteria, array $orderBy = null)
Expand Down

0 comments on commit 9907779

Please sign in to comment.