diff --git a/SearchEndpoint/SearchEndpointFactory.php b/SearchEndpoint/SearchEndpointFactory.php index f6937eb29411ec1745d3cb80b07a54b33f1b63be..430b9e78d875b2e2bd5f5a106c129446f81d0fcd 100644 --- a/SearchEndpoint/SearchEndpointFactory.php +++ b/SearchEndpoint/SearchEndpointFactory.php @@ -37,19 +37,13 @@ class SearchEndpointFactory * @return SearchEndpointInterface * * @throws \RuntimeException Endpoint does not exist. - * @throws \DomainException Endpoint is not implementing SearchEndpointInterface. */ public static function get($type) { if (!array_key_exists($type, self::$endpoints)) { throw new \RuntimeException(); } - $endpoint = new self::$endpoints[$type](); - if ($endpoint instanceof SearchEndpointInterface) { - return $endpoint; - } - - throw new \DomainException(); + return new self::$endpoints[$type](); } }