PHP Intelephense doesn't detect symfony repository functions

4 weeks ago 28
ARTICLE AD BOX

I've recently started using PHP Intelephense (absolutely love it), but one issue that persists. I code within the PHP Symfony framework and will get a red like so:

Image showing two lines of code. The second line is showing a function with a red underline indicating that that function does not exist.

"findExistingCartOrder()" is a function within my repository, but it seems Intelephense cannot detect it. Is there a way to get this fixed? I'm trying to avoid adding comments because I don't want to start adding them all over the place when I absolutely do not need to.

At the top of my repository, I have the following (which is auto generated when creating through the make bundle):

/** * @extends ServiceEntityRepository<SubscriptionOrder> * * @method SubscriptionOrder|null find($id, $lockMode = null, $lockVersion = null) * @method SubscriptionOrder|null findOneBy(array $criteria, array $orderBy = null) * @method SubscriptionOrder[] findAll() * @method SubscriptionOrder[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class SubscriptionOrderRepository extends ServiceEntityRepository

What's the approach here to have PHP Intelephense index this probably? I'm using VSCode.

Read Entire Article