private function getOrCreateEndpoint($endpoint)
    {
        if (!array_key_exists($endpoint, $this->endpoints)) {
            if (!array_key_exists($endpoint, self::$endpointClassMap)) {
                throw new \Exception(sprintf('Unknown endpoint "%s"', $endpoint));
            }

            $endpointClass = self::$endpointClassMap[$endpoint];
            $this->endpoints[$endpoint] = $this->createEndpoint($endpointClass);
        }

        return $this->endpoints[$endpoint];
    }
private function getOrCreateEndpoint($endpoint)
    {
        if (!array_key_exists($endpoint, $this->endpoints)) {
            if (!array_key_exists($endpoint, self::$endpointClassMap)) {
                throw new \Exception(sprintf('Unknown endpoint "%s"', $endpoint));
            }

            $endpointClass = self::$endpointClassMap[$endpoint];
            $this->endpoints[$endpoint] = $this->createEndpoint($endpointClass);
        }

        return $this->endpoints[$endpoint];
    }
private function getOrCreateEndpoint ( $ endpoint ) { if ( ! array_key_exists ( $ endpoint , $ this -> endpoints ) ) { if ( ! array_key_exists ( $ endpoint , self :: $ endpointClassMap ) ) { throw new \ Exception ( sprintf ( 'Unknown endpoint "%s"' , $ endpoint ) ) ; } $ endpointClass = self :: $ endpointClassMap [ $ endpoint ] ; $ this -> endpoints [ $ endpoint ] = $ this -> createEndpoint ( $ endpointClass ) ; } return $ this -> endpoints [ $ endpoint ] ; }
Create or return an cached instance of the requested endpoint.

@param string $endpoint
@return object
@throws \Exception
Create or return an cached instance of the requested endpoint .