Completed
Push — master ( 7fe22c...328c86 )
by Stefano
02:25
created

Proxy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onInit() 0 3 2
A onSend() 0 4 1
1
<?php
2
3
/**
4
 * Email\Proxy
5
 *
6
 * Simple proxy driver. It pass all emails to an event
7
 *
8
 * @package core
9
 * @author [email protected]
10
 * @copyright Caffeina srl - 2016 - http://caffeina.com
11
 */
12
13
namespace Email;
14
15
class Proxy implements Driver {
16
17
  protected $listener = 'core.email.proxy.send';
18
19
  public function onInit($options){
20
    if (!empty($options['hook'])) $this->listener = $options['hook'];
21
  }
22
23
  public function onSend(Envelope $envelope){
24
    \Event::trigger($this->listener, $envelope);
25
    return true;
26
  }
27
28
}
29
30