Swift_Encoding   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 47
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A get7BitEncoding() 0 4 1
A get8BitEncoding() 0 4 1
A getQpEncoding() 0 4 1
A getBase64Encoding() 0 4 1
A _lookup() 0 4 1
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