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

Paymarket::transformCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
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