Paymarket::transformCollection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
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
    public function __construct(Api $api)
19
    {
20
        $this->api = $api;
21
        $this->serviceName = 'paymarket';
22
    }
23
24
    protected function transformCollection(array $collection, string $class): array
25
    {
26
        return array_map(function ($attributes) use ($class) {
27
            return new $class($attributes, $this);
28
        }, $collection);
29
    }
30
}
31