Skip to content

Commit adb632f

Browse files
committed
bah super php
1 parent e8f3a36 commit adb632f

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

clients/algoliasearch-client-php/lib/Algolia.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
namespace Algolia\AlgoliaSearch;
44

55
use Algolia\AlgoliaSearch\Cache\NullCacheDriver;
6-
use Algolia\AlgoliaSearch\Http\CurlHttpClient;
7-
use Algolia\AlgoliaSearch\Http\GuzzleHttpClient;
86
use Algolia\AlgoliaSearch\Http\HttpClientInterface;
97
use Algolia\AlgoliaSearch\Log\DebugLogger;
10-
use GuzzleHttp\Client;
11-
use GuzzleHttp\ClientInterface;
128
use Psr\Log\LoggerInterface;
139
use 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
}

generators/src/main/java/com/algolia/codegen/utils/ModelPruner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void exploreGraph(OperationsMap operations) {
8686
}
8787
}
8888
for (CodegenParameter param : ope.allParams) {
89-
CodegenModel paramType = getModel(param.baseType != null ? param.baseType : param.dataType);
89+
CodegenModel paramType = getModel(param.baseType != null ? param.baseType : param.getSchema().getOpenApiType());
9090
if (paramType != null) {
9191
visitedModels.add(paramType.name);
9292
}

templates/php/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
181181
{{/x-acl}}
182182
{{/vendorExtensions}}
183183
{{#allParams}}
184-
* @param {{#isString}}string{{/isString}}{{#isLong}}int{{/isLong}}{{#isInteger}}int{{/isInteger}}{{#isBoolean}}bool{{/isBoolean}}{{^isString}}{{^isLong}}{{^isInteger}}{{^isBoolean}}array{{/isBoolean}}{{/isInteger}}{{/isLong}}{{/isString}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
184+
* @param {{#isString}}string{{/isString}}{{#isLong}}int{{/isLong}}{{#isInteger}}int{{/isInteger}}{{#isBoolean}}bool{{/isBoolean}}{{^isString}}{{^isLong}}{{^isInteger}}{{^isBoolean}}array{{/isBoolean}}{{/isInteger}}{{/isLong}}{{/isString}} ${{paramName}}{{#description}} {{{.}}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
185185
{{#isModel}}
186186
{{#vars}}
187187
* - ${{paramName}}{{> arrayParam}}

0 commit comments

Comments
 (0)