| Conditions | 4 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 32 | public function getMailService() |
||
| 33 | { |
||
| 34 | if ($this instanceof ServiceLocatorAwareInterface |
||
| 35 | && ! isset($this->mailService) |
||
|
|
|||
| 36 | && $this->getServiceLocator()->has('AcMailer\Service\MailService') |
||
| 37 | ) { |
||
| 38 | $this->mailService = $this->getServiceLocator()->get('AcMailer\Service\MailService'); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this->mailService; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: