Swift_Encoding::_lookup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of SwiftMailer.
5
 * (c) 2004-2009 Chris Corbyn
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
/**
12
 * Provides quick access to each encoding type.
13
 *
14
 * @author Chris Corbyn
15
 */
16
class Swift_Encoding
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
17
{
18
    /**
19
     * Get the Encoder that provides 7-bit encoding.
20
     *
21
     * @return Swift_Mime_ContentEncoder
22
     */
23 1
    public static function get7BitEncoding()
24
    {
25 1
        return self::_lookup('mime.7bitcontentencoder');
26
    }
27
28
    /**
29
     * Get the Encoder that provides 8-bit encoding.
30
     *
31
     * @return Swift_Mime_ContentEncoder
32
     */
33 1
    public static function get8BitEncoding()
34
    {
35 1
        return self::_lookup('mime.8bitcontentencoder');
36
    }
37
38
    /**
39
     * Get the Encoder that provides Quoted-Printable (QP) encoding.
40
     *
41
     * @return Swift_Mime_ContentEncoder
42
     */
43 1
    public static function getQpEncoding()
44
    {
45 1
        return self::_lookup('mime.qpcontentencoder');
46
    }
47
48
    /**
49
     * Get the Encoder that provides Base64 encoding.
50
     *
51
     * @return Swift_Mime_ContentEncoder
52
     */
53 1
    public static function getBase64Encoding()
54
    {
55 1
        return self::_lookup('mime.base64contentencoder');
56
    }
57
58 4
    private static function _lookup($key)
59
    {
60 4
        return Swift_DependencyContainer::getInstance()->lookup($key);
61
    }
62
}
63