33namespace Algolia \AlgoliaSearch ;
44
55use Algolia \AlgoliaSearch \Cache \NullCacheDriver ;
6- use Algolia \AlgoliaSearch \Http \CurlHttpClient ;
7- use Algolia \AlgoliaSearch \Http \GuzzleHttpClient ;
86use Algolia \AlgoliaSearch \Http \HttpClientInterface ;
97use Algolia \AlgoliaSearch \Log \DebugLogger ;
10- use GuzzleHttp \Client ;
11- use GuzzleHttp \ClientInterface ;
128use Psr \Log \LoggerInterface ;
139use Psr \SimpleCache \CacheInterface ;
1410
@@ -19,19 +15,19 @@ final class Algolia
1915 /**
2016 * Holds an instance of the simple cache repository (PSR-16).
2117 *
22- * @var null|CacheInterface
18+ * @var null|\Psr\SimpleCache\ CacheInterface
2319 */
2420 private static $ cache ;
2521
2622 /**
2723 * Holds an instance of the logger (PSR-3).
2824 *
29- * @var null|LoggerInterface
25+ * @var null|\Psr\Log\ LoggerInterface
3026 */
3127 private static $ logger ;
3228
3329 /**
34- * @var HttpClientInterface
30+ * @var \Algolia\AlgoliaSearch\Http\ HttpClientInterface
3531 */
3632 private static $ httpClient ;
3733
@@ -47,7 +43,7 @@ public static function isCacheEnabled()
4743 /**
4844 * Gets the cache instance.
4945 *
50- * @return CacheInterface
46+ * @return \Psr\SimpleCache\ CacheInterface
5147 */
5248 public static function getCache ()
5349 {
@@ -69,7 +65,7 @@ public static function setCache(CacheInterface $cache)
6965 /**
7066 * Gets the logger instance.
7167 *
72- * @return LoggerInterface
68+ * @return \Psr\Log\ LoggerInterface
7369 */
7470 public static function getLogger ()
7571 {
@@ -94,23 +90,23 @@ public static function getHttpClient()
9490 if (interface_exists ('\GuzzleHttp\ClientInterface ' )) {
9591 if (defined ('\GuzzleHttp\ClientInterface::VERSION ' )) {
9692 $ guzzleVersion = (int ) mb_substr (
97- Client::VERSION ,
93+ \ GuzzleHttp \ Client::VERSION ,
9894 0 ,
9995 1
10096 );
10197 } else {
102- $ guzzleVersion = ClientInterface::MAJOR_VERSION ;
98+ $ guzzleVersion = \ GuzzleHttp \ ClientInterface::MAJOR_VERSION ;
10399 }
104100 }
105101
106102 if (null === self ::$ httpClient ) {
107103 if (class_exists ('\GuzzleHttp\Client ' ) && 6 <= $ guzzleVersion ) {
108104 self ::setHttpClient (
109- new GuzzleHttpClient ()
105+ new \ Algolia \ AlgoliaSearch \ Http \ GuzzleHttpClient ()
110106 );
111107 } else {
112108 self ::setHttpClient (
113- new CurlHttpClient ()
109+ new \ Algolia \ AlgoliaSearch \ Http \ CurlHttpClient ()
114110 );
115111 }
116112 }
0 commit comments