Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | public function getMailService() |
||
33 | { |
||
34 | if ( |
||
35 | $this instanceof ServiceLocatorAwareInterface |
||
36 | && ! isset($this->mailService) |
||
|
|||
37 | && $this->getServiceLocator()->has('AcMailer\Service\MailService') |
||
38 | ) { |
||
39 | $this->mailService = $this->getServiceLocator()->get('AcMailer\Service\MailService'); |
||
40 | } |
||
41 | |||
42 | return $this->mailService; |
||
43 | } |
||
44 | } |
||
45 |
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: