-
- Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Phpstorm version: 2016.3.3
Plugin version: 0.13.138
Considering Account entity and AccountRepository for it, then the following code in the repository clas:
/** * @param string $accountEmail * * @return null|Account */ public function getAccountByEmail(string $email) { return $this->findOneBy(['email' => $email]); } would result in "return" statement being marked as incorrect, due to type mismatch. There's no auto-complete for fields names as well.
However, the following function would have all the auto-complete and return type is detected correctly:
/** * @param string $accountEmail * * @return null|Account */ public function getAccountByEmail2(string $accountEmail) { return $this->getEntityManager()->getRepository('AccountBundle:Account')->findOneBy(['email' => $accountEmail]); } aalwash