Skip to content

Commit b2eacf5

Browse files
committed
feature #1088 Add @extends tag to Doctrine repository template. (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.
2 parents 11cc24d + 73b5aee commit b2eacf5

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<?= ($with_password_upgrade && str_contains($password_upgrade_user_interface->getFullName(), '\UserInterface')) ? sprintf("use %s;\n", $password_upgrade_user_interface->getFullName()) : null ?>
1414

1515
/**
16+
* @extends ServiceEntityRepository<<?= $entity_class_name; ?>>
17+
*
1618
* @method <?= $entity_class_name; ?>|null find($id, $lockMode = null, $lockVersion = null)
1719
* @method <?= $entity_class_name; ?>|null findOneBy(array $criteria, array $orderBy = null)
1820
* @method <?= $entity_class_name; ?>[] findAll()

tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Doctrine\Persistence\ManagerRegistry;
1010

1111
/**
12+
* @extends ServiceEntityRepository<UserXml>
13+
*
1214
* @method UserXml|null find($id, $lockMode = null, $lockVersion = null)
1315
* @method UserXml|null findOneBy(array $criteria, array $orderBy = null)
1416
* @method UserXml[] findAll()

tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Doctrine\Persistence\ManagerRegistry;
1010

1111
/**
12+
* @extends ServiceEntityRepository<XOther>
13+
*
1214
* @method XOther|null find($id, $lockMode = null, $lockVersion = null)
1315
* @method XOther|null findOneBy(array $criteria, array $orderBy = null)
1416
* @method XOther[] findAll()

0 commit comments

Comments
 (0)