Service::compile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Request Provider Class
6
 * @category    Ticaje
7
 * @author      Max Demian <[email protected]>
8
 */
9
10
namespace Ticaje\AeSdk\Infrastructure\Provider\Request\Builder;
11
12
use Ticaje\AeSdk\Infrastructure\Interfaces\Provider\Request\Builder\ServiceBuilderInterface;
13
14
/**
15
 * Class Service
16
 * @package Ticaje\AeSdk\Infrastructure\Provider\Request\Builder
17
 */
18
class Service implements ServiceBuilderInterface
19
{
20
    /**
21
     * @inheritDoc
22
     * Specific business logic
23
     */
24
    public function compile(array $request = []): string
25
    {
26
        $result = '';
27
        array_walk($request, function ($value, $key) use (&$result) {
28
            $result .= "{$key}=$value&"; // Exact business policy
29
        });
30
        return $result;
31
    }
32
}
33