Completed
Push — master ( fad20c...da5feb )
by Lawrence
01:25
created

plinker_client()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
1
<?php
2
/*
3
 +------------------------------------------------------------------------+
4
 | Plinker-RPC PHP                                                        |
5
 +------------------------------------------------------------------------+
6
 | Copyright (c)2017-2018 (https://github.com/plinker-rpc/core)           |
7
 +------------------------------------------------------------------------+
8
 | This source file is subject to MIT License                             |
9
 | that is bundled with this package in the file LICENSE.                 |
10
 |                                                                        |
11
 | If you did not receive a copy of the license and are unable to         |
12
 | obtain it through the world-wide-web, please send an email             |
13
 | to [email protected] so we can send you a copy immediately.        |
14
 +------------------------------------------------------------------------+
15
 | Authors: Lawrence Cherone <[email protected]>                     |
16
 +------------------------------------------------------------------------+
17
 */
18
19
// global connect function
20
namespace {
21
    if (!function_exists('\plinker_client')) {
22
        function plinker_client($url, $secret, $options = [])
23
        {
24
            $options = array_merge([
25
                "secret" => $secret
26
            ], $options);
27
            return new \Plinker\Core\Client(
28
                $url,
29
                $options
30
            );
31
        }
32
    }
33
}
34