src/Api/Factory/MiddlewareApiFactory.php
public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    )
    {
        $payloadMeta = $this->mapper->getPayloadMeta($data);
        if ($action === 'request') {
            return new RequestApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getServiceCall($data),
                $payloadMeta,
                $this->mapper->getRequestAttributes($data)
            );

        } elseif($action === 'response') {
            return new ResponseApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getHttpResponse($data),
                $this->mapper->getTransport($data),
                $this->mapper->getPayloadMeta($data),
                $this->mapper->getReturnValue($data)
            );
        }

    }
public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    )
    {
        $payloadMeta = $this->mapper->getPayloadMeta($data);
        if ($action === 'request') {
            return new RequestApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getServiceCall($data),
                $payloadMeta,
                $this->mapper->getRequestAttributes($data)
            );

        } elseif($action === 'response') {
            return new ResponseApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getHttpResponse($data),
                $this->mapper->getTransport($data),
                $this->mapper->getPayloadMeta($data),
                $this->mapper->getReturnValue($data)
            );
        }

    }
public function build ( $ action , array $ data , CliInput $ input , Mapping $ mapping ) { $ payloadMeta = $ this -> mapper -> getPayloadMeta ( $ data ) ; if ( $ action === 'request' ) { return new RequestApi ( $ this -> logger -> getRequestLogger ( $ payloadMeta -> getId ( ) ) , $ this -> component , $ mapping , dirname ( realpath ( $ _SERVER [ 'SCRIPT_FILENAME' ] ) ) , $ input -> getName ( ) , $ input -> getVersion ( ) , $ input -> getFrameworkVersion ( ) , $ input -> getVariables ( ) , $ input -> isDebug ( ) , $ this -> mapper -> getHttpRequest ( $ data ) , $ this -> mapper -> getServiceCall ( $ data ) , $ payloadMeta , $ this -> mapper -> getRequestAttributes ( $ data ) ) ; } elseif ( $ action === 'response' ) { return new ResponseApi ( $ this -> logger -> getRequestLogger ( $ payloadMeta -> getId ( ) ) , $ this -> component , $ mapping , dirname ( realpath ( $ _SERVER [ 'SCRIPT_FILENAME' ] ) ) , $ input -> getName ( ) , $ input -> getVersion ( ) , $ input -> getFrameworkVersion ( ) , $ input -> getVariables ( ) , $ input -> isDebug ( ) , $ this -> mapper -> getHttpRequest ( $ data ) , $ this -> mapper -> getHttpResponse ( $ data ) , $ this -> mapper -> getTransport ( $ data ) , $ this -> mapper -> getPayloadMeta ( $ data ) , $ this -> mapper -> getReturnValue ( $ data ) ) ; } }
Build a Request Api class instance

@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return Api
Build a Request Api class instance