GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Config::__construct()   A
last analyzed

Complexity

Conditions 5
Paths 5

Size

Total Lines 46
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 21
nc 5
nop 1
dl 0
loc 46
rs 9.2728
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Email\DataStructures;
15
16
// ------------------------------------------------------------------------
17
18
/**
19
 * Class Config
20
 *
21
 * @package O2System\Email\DataStructures
22
 */
23
class Config extends \O2System\Kernel\DataStructures\Config
24
{
25
    /**
26
     * Config::__construct
27
     *
28
     * @param array $config
29
     */
30
    public function __construct(array $config = [])
31
    {
32
        $defaultConfig = [
33
            'protocol'  => 'mail',
34
            'userAgent' => 'O2System\Email',
35
            'wordwrap'  => false,
36
        ];
37
38
        if (isset($config[ 'protocol' ])) {
39
            switch ($config[ 'protocol' ]) {
40
                default:
41
                case 'mail':
42
43
                    break;
44
45
                case 'sendmail':
46
47
                    // Path to sendmail binary
48
                    $defaultConfig[ 'mailPath' ] = '/usr/sbin/sendmail';
49
50
                    break;
51
52
                case 'smtp':
53
54
                    // SMTP Host can be an IP Address or domain name
55
                    $defaultConfig[ 'host' ] = '';
56
57
                    // SMTP Port by default it's set to 25
58
                    $defaultConfig[ 'port' ] = 25;
59
60
                    // SMTP Username
61
                    $defaultConfig[ 'user' ] = '';
62
63
                    // SMTP Password
64
                    $defaultConfig[ 'pass' ] = '';
65
66
                    // SMTP Encryption empty, tls or ssl
67
                    $defaultConfig[ 'encryption' ] = '';
68
69
                    break;
70
            }
71
        }
72
73
        $config = array_merge($defaultConfig, $config);
74
75
        parent::__construct($config);
76
    }
77
}