Completed
Push — master ( 38a4e8...c04e1d )
by Vladimir
11s
created

Paymarket   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A transformCollection() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AcquiroPay\Paymarket;
6
7
use AcquiroPay\Api;
8
use AcquiroPay\MakesHttpRequests;
9
use AcquiroPay\Paymarket\Actions\ManagesServices;
10
use AcquiroPay\Paymarket\Actions\ManagesTransactions;
11
12
class Paymarket
13
{
14
    use MakesHttpRequests,
15
        ManagesServices,
16
        ManagesTransactions;
17
18
    /** @var \GuzzleHttp\Client */
19
    public $client;
20
21
    public function __construct(Api $api)
22
    {
23
        $this->api = $api;
24
        $this->serviceName = 'paymarket';
25
    }
26
27
    protected function transformCollection(array $collection, string $class): array
28
    {
29
        return array_map(function ($attributes) use ($class) {
30
            return new $class($attributes, $this);
31
        }, $collection);
32
    }
33
}
34