Completed
Push — master ( 532b1f...89ab0b )
by Mr
04:53 queued 11s
created

ConfigWrapper::getServer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace OpenVPN\Laravel;
4
5
use OpenVPN\Config;
6
use OpenVPN\Interfaces\ConfigInterface;
7
8
class ConfigWrapper
9
{
10
    /**
11
     * Get client configuration of OpenVPN
12
     *
13
     * @param array $params
14
     *
15
     * @return \OpenVPN\Interfaces\ConfigInterface
16
     */
17 View Code Duplication
    public function getClient(array $params = []): ConfigInterface
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19
        $configs = config('openvpn-client');
20
        $configs = array_merge($configs, $params);
21
        $object  = new Config($configs);
22
23
        return $object->client();
24
    }
25
26
    /**
27
     * Get server configuration of OpenVPN
28
     *
29
     * @param array $params
30
     *
31
     * @return \OpenVPN\Interfaces\ConfigInterface
32
     */
33 View Code Duplication
    public function getServer(array $params = []): ConfigInterface
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $configs = config('openvpn-server');
36
        $configs = array_merge($configs, $params);
37
38
        return new Config($configs);
39
    }
40
}
41