Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | protected function sendEmailToApprover(DNDeployment $deployment) { |
||
13 | if (!$deployment->Approver()->exists()) { |
||
|
|||
14 | return false; |
||
15 | } |
||
16 | |||
17 | $email = new Email(); |
||
18 | $email->setTo($deployment->Approver()->Email); |
||
19 | $email->replyTo($deployment->Deployer()->Email); |
||
20 | $email->setSubject('Deployment has been scheduled'); |
||
21 | $email->setTemplate('DeploymentNotificationSubmitted'); |
||
22 | $email->populateTemplate($deployment); |
||
23 | $email->send(); |
||
24 | |||
25 | $log = $deployment->log(); |
||
26 | $log->write(sprintf( |
||
27 | 'Deployment submitted email sent to approver %s <%s>', |
||
28 | $approver->Name, |
||
29 | $approver->Email |
||
30 | )); |
||
31 | } |
||
32 | |||
55 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: