Passed
Pull Request — 4 (#10048)
by Steve
08:26
created

Swift_MailTransport   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newInstance() 0 3 1
A __construct() 0 9 1
1
<?php
2
3
/**
4
 * This file was copied in from swiftmailer/swiftmailer v5.4.12 after it was removed from switftmailer v6
5
 * It has been slightly modified to meet phpcs standards
6
 */
7
8
/*
9
 * This file is part of SwiftMailer.
10
 * (c) 2004-2009 Chris Corbyn
11
 *
12
 * For the full copyright and license information, please view the LICENSE file (MIT)
13
 * https://github.com/swiftmailer/swiftmailer/blob/181b89f18a90f8925ef805f950d47a7190e9b950/LICENSE
14
 */
15
16
/**
17
 * Sends Messages using the mail() function.
18
 *
19
 * @author Chris Corbyn
20
 *
21
 * at deprecated since 5.4.5 (to be removed in 6.0)
22
 *
23
 * @internal
24
 */
25
// @codingStandardsIgnoreStart
26
// ignore missing namespace
27
class Swift_MailTransport extends Swift_Transport_MailTransport
28
// @codingStandardsIgnoreEnd
29
{
30
    /**
31
     * Create a new MailTransport, optionally specifying $extraParams.
32
     *
33
     * @param string $extraParams
34
     */
35
    public function __construct($extraParams = '-f%s')
36
    {
37
        call_user_func_array(
38
            [$this, 'Swift_Transport_MailTransport::__construct'],
39
            Swift_DependencyContainer::getInstance()
40
                ->createDependenciesFor('transport.mail')
41
        );
42
43
        $this->setExtraParams($extraParams);
44
    }
45
46
    /**
47
     * Create a new MailTransport instance.
48
     *
49
     * @param string $extraParams To be passed to mail()
50
     *
51
     * @return self
52
     */
53
    public static function newInstance($extraParams = '-f%s')
54
    {
55
        return new self($extraParams);
56
    }
57
}
58