src/Api/Factory/ServiceApiFactory.php
public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    ) {
        $context = new ZMQContext();
        $socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
        $socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);

        if ($input->getMapping() === 'compact') {
            $transportMapper = new CompactTransportMapper();
            $runtimeCallMapper = new CompactRuntimeCallMapper($transportMapper);
        } else {
            $transportMapper = new ExtendedTransportMapper();
            $runtimeCallMapper = new ExtendedRuntimeCallMapper($transportMapper);
        }

        $caller = new ZeroMQRuntimeCaller(
            new MessagePackSerializer(),
            new CompactTransportMapper(),
            $socket,
            $runtimeCallMapper,
            new Timer()
        );

        $transport = $this->mapper->getTransport($data);
        return new ActionApi(
            $this->logger->getRequestLogger($transport->getMeta()->getId()),
            $this->component,
            $mapping,
            dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
            $input->getName(),
            $input->getVersion(),
            $input->getFrameworkVersion(),
            $input->getVariables(),
            $input->isDebug(),
            $action,
            $caller,
            $transport,
            new TypeCatalog(),
            $this->mapper->getParams($data)
        );
    }
public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    ) {
        $context = new ZMQContext();
        $socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
        $socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);

        if ($input->getMapping() === 'compact') {
            $transportMapper = new CompactTransportMapper();
            $runtimeCallMapper = new CompactRuntimeCallMapper($transportMapper);
        } else {
            $transportMapper = new ExtendedTransportMapper();
            $runtimeCallMapper = new ExtendedRuntimeCallMapper($transportMapper);
        }

        $caller = new ZeroMQRuntimeCaller(
            new MessagePackSerializer(),
            new CompactTransportMapper(),
            $socket,
            $runtimeCallMapper,
            new Timer()
        );

        $transport = $this->mapper->getTransport($data);
        return new ActionApi(
            $this->logger->getRequestLogger($transport->getMeta()->getId()),
            $this->component,
            $mapping,
            dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
            $input->getName(),
            $input->getVersion(),
            $input->getFrameworkVersion(),
            $input->getVariables(),
            $input->isDebug(),
            $action,
            $caller,
            $transport,
            new TypeCatalog(),
            $this->mapper->getParams($data)
        );
    }
public function build ( $ action , array $ data , CliInput $ input , Mapping $ mapping ) { $ context = new ZMQContext ( ) ; $ socket = new ZMQSocket ( $ context , ZMQ :: SOCKET_REQ ) ; $ socket -> setSockOpt ( ZMQ :: SOCKOPT_LINGER , 0 ) ; if ( $ input -> getMapping ( ) === 'compact' ) { $ transportMapper = new CompactTransportMapper ( ) ; $ runtimeCallMapper = new CompactRuntimeCallMapper ( $ transportMapper ) ; } else { $ transportMapper = new ExtendedTransportMapper ( ) ; $ runtimeCallMapper = new ExtendedRuntimeCallMapper ( $ transportMapper ) ; } $ caller = new ZeroMQRuntimeCaller ( new MessagePackSerializer ( ) , new CompactTransportMapper ( ) , $ socket , $ runtimeCallMapper , new Timer ( ) ) ; $ transport = $ this -> mapper -> getTransport ( $ data ) ; return new ActionApi ( $ this -> logger -> getRequestLogger ( $ transport -> getMeta ( ) -> getId ( ) ) , $ this -> component , $ mapping , dirname ( realpath ( $ _SERVER [ 'SCRIPT_FILENAME' ] ) ) , $ input -> getName ( ) , $ input -> getVersion ( ) , $ input -> getFrameworkVersion ( ) , $ input -> getVariables ( ) , $ input -> isDebug ( ) , $ action , $ caller , $ transport , new TypeCatalog ( ) , $ this -> mapper -> getParams ( $ data ) ) ; }
Build an Action Api class instance

@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return ActionApi
Build an Action Api class instance