From 26a922736a692021dfffdd5da9cd291fd48d98cc Mon Sep 17 00:00:00 2001 From: Martynas Sudintas <martynas.sudintas@ongr.io> Date: Mon, 18 May 2015 11:16:59 +0300 Subject: [PATCH] Removed check for instance in SearchEndpointFactory --- SearchEndpoint/SearchEndpointFactory.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/SearchEndpoint/SearchEndpointFactory.php b/SearchEndpoint/SearchEndpointFactory.php index f6937eb..430b9e7 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](); } } -- GitLab