SwiftAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 53
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 4 1
getMailer() 0 1 ?
getMessage() 0 1 ?
send() 0 1 ?
1
<?php
2
/**
3
 * Jaeger
4
 *
5
 * @copyright	Copyright (c) 2015-2016, mithra62
6
 * @link		http://jaeger-app.com
7
 * @version		1.0
8
 * @filesource 	./Email/SwiftAbstract.php
9
 */
10
namespace JaegerApp\Email;
11
12
/**
13
 * Jaeger - Email Abstract
14
 *
15
 * Defines what email objects should contain
16
 *
17
 * @package Email
18
 * @author Eric Lamb <[email protected]>
19
 */
20
abstract class SwiftAbstract
21
{
22
    /**
23
     * The configuration details for sending the email
24
     * @var array
25
     */
26
    protected $config = array();
27
    
28
    /**
29
     * The version of Swiftmailer we're using
30
     * @var string
31
     */
32
    protected $version;
33
    
34
    /**
35
     * The instance of Swiftmailer
36
     * @var \Swift_Mailer
37
     */
38
    protected $mailer;
39
    
40
    /**
41
     * Returns the version of Swiftmailer we're using
42
     * @return string
43
     */
44
    public function getVersion()
45
    {
46
        return $this->version;
47
    }
48
    
49
    /**
50
     * Returns the mailer object
51
     * @return Swift_Mailer
52
     */
53
    abstract public function getMailer();   
54
    
55
    /**
56
     * Abstract for creating the message object
57
     * @param array $to
58
     * @param string $from_email
59
     * @param string $from_name
60
     * @param string $subject
61
     * @param string $message_body
62
     * @param array $attachments
63
     * @param string $mail_type
64
     */
65
    abstract public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type='html');
66
    
67
    /**
68
     * Wrapper to send the message
69
     * @param object $message
70
     */
71
    abstract public function send($message, $extra = null);
72
}