Completed
Pull Request — master (#58)
by Rafael
02:58
created

BanklyCard   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A transactions() 0 11 1
1
<?php
2
3
namespace WeDevBr\Bankly;
4
5
use WeDevBr\Bankly\Auth\Auth;
6
use WeDevBr\Bankly\Traits\Rest;
7
8
/**
9
 * Class Card
10
 * @author Rafael Teixeira <[email protected]>
11
 * @package WeDevBr\Bankly
12
 */
13
class BanklyCard
14
{
15
    use Rest;
16
17
    /**
18
     * @param string $clientSecret
19
     * @param string $clientId
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22
    public function __construct($clientSecret = null, $clientId = null)
23
    {
24
        Auth::login()
25
            ->setClientId($clientId)
26
            ->setClientId($clientSecret);
27
    }
28
29
    /**
30
     * @param string $proxy
31
     * @param string $page
32
     * @param integer $pageSize
33
     * @param string $startDate
34
     * @param string $endDate
35
     * @return array
36
     */
37
    public function transactions(string $proxy, string $page, int $pageSize, string $startDate, string $endDate)
38
    {
39
        $query = [
40
            'page' => $page,
41
            'pageSize' => $pageSize,
42
            'startDate' => $startDate,
43
            'endDate' => $endDate
44
        ];
45
46
        return $this->get("/cards/{$proxy}/transactions", $query);
47
    }
48
}
49