Skip to content

Commit

Permalink
feature #1088 Add @extends tag to Doctrine repository template. (…
Browse files Browse the repository at this point in the history
…Hugo Hamon)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Add ``@extends`` tag to Doctrine repository template.

Adding the ``@extends`` phpdoc tag on generated Doctrine repository classes will prevent phpstan from generating an error when it's installed in the project.

Commits
-------

73b5aee Add ``@extends`` tag to Doctrine repository template.
  • Loading branch information
weaverryan committed Apr 5, 2022
2 parents 11cc24d + 73b5aee commit b2eacf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Resources/skeleton/doctrine/Repository.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<?= ($with_password_upgrade && str_contains($password_upgrade_user_interface->getFullName(), '\UserInterface')) ? sprintf("use %s;\n", $password_upgrade_user_interface->getFullName()) : null ?>

/**
* @extends ServiceEntityRepository<<?= $entity_class_name; ?>>
*
* @method <?= $entity_class_name; ?>|null find($id, $lockMode = null, $lockVersion = null)
* @method <?= $entity_class_name; ?>|null findOneBy(array $criteria, array $orderBy = null)
* @method <?= $entity_class_name; ?>[] findAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Doctrine\Persistence\ManagerRegistry;

/**
* @extends ServiceEntityRepository<UserXml>
*
* @method UserXml|null find($id, $lockMode = null, $lockVersion = null)
* @method UserXml|null findOneBy(array $criteria, array $orderBy = null)
* @method UserXml[] findAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Doctrine\Persistence\ManagerRegistry;

/**
* @extends ServiceEntityRepository<XOther>
*
* @method XOther|null find($id, $lockMode = null, $lockVersion = null)
* @method XOther|null findOneBy(array $criteria, array $orderBy = null)
* @method XOther[] findAll()
Expand Down

0 comments on commit b2eacf5

Please sign in to comment.