public function client($name, Closure $closure = null)
    {
        if ($this->has($name)) {
            /** @var Service $service */
            $service = $this->services[$name];

            if (is_null($service->getClient())) {
                $client = new Client($service->getWsdl(), $service->getOptions(), $service->getHeaders());
              
                $service->client($client);
            } else {
                $client = $service->getClient();
            }

            return $closure($client);
        }

        throw new ServiceNotFound("Service '" . $name . "' not found.");
    }
public function client($name, Closure $closure = null)
    {
        if ($this->has($name)) {
            /** @var Service $service */
            $service = $this->services[$name];

            if (is_null($service->getClient())) {
                $client = new Client($service->getWsdl(), $service->getOptions(), $service->getHeaders());
              
                $service->client($client);
            } else {
                $client = $service->getClient();
            }

            return $closure($client);
        }

        throw new ServiceNotFound("Service '" . $name . "' not found.");
    }
public function client ( $ name , Closure $ closure = null ) { if ( $ this -> has ( $ name ) ) { /** @var Service $service */ $ service = $ this -> services [ $ name ] ; if ( is_null ( $ service -> getClient ( ) ) ) { $ client = new Client ( $ service -> getWsdl ( ) , $ service -> getOptions ( ) , $ service -> getHeaders ( ) ) ; $ service -> client ( $ client ) ; } else { $ client = $ service -> getClient ( ) ; } return $ closure ( $ client ) ; } throw new ServiceNotFound ( "Service '" . $ name . "' not found." ) ; }
Get the client

@param string  $name
@param Closure $closure

@return mixed
@throws ServiceNotFound
Get the client