33namespace Algolia \AlgoliaSearch ;
44
55use Algolia \AlgoliaSearch \Cache \NullCacheDriver ;
6+ use Algolia \AlgoliaSearch \Http \CurlHttpClient ;
7+ use Algolia \AlgoliaSearch \Http \GuzzleHttpClient ;
68use Algolia \AlgoliaSearch \Http \HttpClientInterface ;
79use Algolia \AlgoliaSearch \Log \DebugLogger ;
10+ use GuzzleHttp \Client ;
11+ use GuzzleHttp \ClientInterface ;
812use Psr \Log \LoggerInterface ;
913use Psr \SimpleCache \CacheInterface ;
1014
@@ -15,19 +19,19 @@ final class Algolia
1519 /**
1620 * Holds an instance of the simple cache repository (PSR-16).
1721 *
18- * @var null|\Psr\SimpleCache\ CacheInterface
22+ * @var null|CacheInterface
1923 */
2024 private static $ cache ;
2125
2226 /**
2327 * Holds an instance of the logger (PSR-3).
2428 *
25- * @var null|\Psr\Log\ LoggerInterface
29+ * @var null|LoggerInterface
2630 */
2731 private static $ logger ;
2832
2933 /**
30- * @var \Algolia\AlgoliaSearch\Http\ HttpClientInterface
34+ * @var HttpClientInterface
3135 */
3236 private static $ httpClient ;
3337
@@ -43,7 +47,7 @@ public static function isCacheEnabled()
4347 /**
4448 * Gets the cache instance.
4549 *
46- * @return \Psr\SimpleCache\ CacheInterface
50+ * @return CacheInterface
4751 */
4852 public static function getCache ()
4953 {
@@ -65,7 +69,7 @@ public static function setCache(CacheInterface $cache)
6569 /**
6670 * Gets the logger instance.
6771 *
68- * @return \Psr\Log\ LoggerInterface
72+ * @return LoggerInterface
6973 */
7074 public static function getLogger ()
7175 {
@@ -90,23 +94,23 @@ public static function getHttpClient()
9094 if (interface_exists ('\GuzzleHttp\ClientInterface ' )) {
9195 if (defined ('\GuzzleHttp\ClientInterface::VERSION ' )) {
9296 $ guzzleVersion = (int ) mb_substr (
93- \ GuzzleHttp \ Client::VERSION ,
97+ Client::VERSION ,
9498 0 ,
9599 1
96100 );
97101 } else {
98- $ guzzleVersion = \ GuzzleHttp \ ClientInterface::MAJOR_VERSION ;
102+ $ guzzleVersion = ClientInterface::MAJOR_VERSION ;
99103 }
100104 }
101105
102106 if (null === self ::$ httpClient ) {
103107 if (class_exists ('\GuzzleHttp\Client ' ) && 6 <= $ guzzleVersion ) {
104108 self ::setHttpClient (
105- new \ Algolia \ AlgoliaSearch \ Http \ GuzzleHttpClient ()
109+ new GuzzleHttpClient ()
106110 );
107111 } else {
108112 self ::setHttpClient (
109- new \ Algolia \ AlgoliaSearch \ Http \ CurlHttpClient ()
113+ new CurlHttpClient ()
110114 );
111115 }
112116 }
0 commit comments