Native::onInit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Email\Native
5
 *
6
 * Email\Native PHP mail() driver.
7
 *
8
 * @package core
9
 * @author [email protected]
10
 * @copyright Caffeina srl - 2016 - http://caffeina.com
11
 */
12
13
namespace Email;
14
15
class Native implements Driver {
16
  
17
  public function onInit($options){}
18
19
  public function onSend(Envelope $envelope){
20
    $results 		= [];
21
    $recipients 	= $envelope->to();
22
    $envelope->to(false);
23
    foreach ($recipients as $to) {
24
      $results[$to] = mail($to,$envelope->subject(),$envelope->body(),$envelope->head());
25
    }
26
    return $results;
27
  }
28
29
}
30
31