BetfairFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createBetfair() 0 14 2
1
<?php
2
3
namespace Betfair;
4
5
use Betfair\Client\BetfairClient;
6
use Betfair\Client\BetfairGuzzleClientFactory;
7
use Betfair\Credential\Credential;
8
9
class BetfairFactory
10
{
11
    public static function createBetfair($applicationId, $betfairUsername, $betfairPassword, $options = array())
12
    {
13
        $credential = new Credential($applicationId, $betfairUsername, $betfairPassword);
14
        $factory = new BetfairGuzzleClientFactory(__DIR__."/Resources/specification");
15
        $betfairClient = new BetfairClient($credential, $factory->createBetfairGuzzleClient($options));
16
17
        $responseAdapter = null;
18
19
        if (isset($options["responseAdapter"])) {
20
            $responseAdapter = $options["responseAdapter"];
21
        }
22
23
        return new Betfair($betfairClient, $responseAdapter);
24
    }
25
}
26