Completed
Push — master ( ef5096...ded87a )
by Peter
02:24
created

Account::getAccountFunds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 10
loc 10
rs 9.4285
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace PeterColes\Betfair\Api;
4
5
use PeterColes\Betfair\Http\Client as HttpClient;
6
7
class Account
8
{
9
    const ENDPOINT = 'https://api.betfair.com/exchange/account/rest/v1.0/';
10
11
    protected $httpClient;
12
13
    public function __construct(HttpClient $httpClient = null)
14
    {
15
        $this->httpClient = $httpClient ?: new HttpClient;
16
    }
17
18
    public function getAccountDetails()
19
    {
20
        return $this->httpClient
21
            ->setEndPoint(self::ENDPOINT.'getAccountDetails/')
22
            ->authHeaders()
23
            ->send();
24
    }
25
26 View Code Duplication
    public function getAccountFunds($wallet = null)
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...
27
    {
28
        return $this->httpClient
29
            ->setMethod('post')
30
            ->setEndPoint(self::ENDPOINT.'getAccountFunds/')
31
            ->authHeaders()
32
            ->addHeader([ 'Content-Type' => 'application/json' ])
33
            ->setWallet($wallet)
34
            ->send();
35
    }
36
}
37