ApiComplexMediator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRequestWrapper() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Api Class
6
 * @category    Ticaje
7
 * @author      Max Demian <[email protected]>
8
 */
9
10
namespace Ticaje\AeSdk\Api\Traits\Mediator;
11
12
use Ticaje\AeSdk\Domain\Interfaces\Request\ProductSendingInterface as DomainProductPostPolicy;
13
14
/**
15
 * Trait ApiComplexMediator
16
 * @package Ticaje\AeSdk\Api\Traits\Mediator
17
 */
18
trait ApiComplexMediator
19
{
20
    /**
21
     * @param $method
22
     * @return string
23
     */
24
    private function getRequestWrapper($method)
25
    {
26
        /** @var DomainProductPostPolicy $requester */
27
        $requester = $this->pool->get(static::REQUEST_SERVICE_MAPPER[$method]);
0 ignored issues
show
Bug introduced by
The constant Ticaje\AeSdk\Api\Traits\...:REQUEST_SERVICE_MAPPER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
28
        $result = $requester->getParamsWrapperKey();
29
        $this->pool->free($requester); // Free worker so being available now
30
        return $result;
31
    }
32
}
33