Describe the bug
So we are in the middle of porting our system to V4 and we encountered an issue with the caching mechanism.
After upgrading to v3.0.2 when ever SET_CACHE_RATELIMIT is set to true i get the following error
<br />
<b>Fatal error</b>: Uncaught TypeError: Argument 4 passed to RiotAPI\LeagueAPI\Definitions\RateLimitControl::`registerLimits() must be of the type string or null, array given, called in /var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php on line 607 and defined in /var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/Definitions/RateLimitControl.php:72
Stack trace:
#0 /var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php(607): RiotAPI\LeagueAPI\Definitions\RateLimitControl->registerLimits('[redacted]...', 'euw', '1416:summoner/s...', Array, Array)
#1 /var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php(1231): RiotAPI\LeagueAPI\LeagueAPI->RiotAPI\LeagueAPI\{closure}(Object(RiotAPI\LeagueAPI\LeagueAPI), 'https://euw1.ap...', 'ed56e305f3d5a59...', '/var/www/[redacted]...')
#2 /var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php(1071): RiotAPI\LeagueAPI\LeagueAPI->_afterCall('https://euw1.ap...', 'ed56e305f3d5a59...', ' in <b>/var/www/[redacted]/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php</b> on line <b>1100</b><br />
(I redacted info that shouldn't be here :))
To Reproduce
Steps to reproduce the behavior:
Instantiate LeagueAPI with SET_CACHE_RATELIMIT set to true (We are using a custom redis ICacheprovider implementation but from my tests the failure occurs before it even reaches that point)
Make any request to Riot API
Expected behavior
The library should return the relevant data.
Screenshots
Not relevant
Server (please complete the following information):
PHP version: PHP 7.2.13
Additional context
After playing around with the code I found out that the headers are returned in a weird format.
here is the result from var_dump straight from the call function before the ICacheProvider is even contacted (This is ran with an empty cache so that everything is returned from Riot API).
Hello and thanks for the bug report!
This happend when I switched to Guzzle.. Dunno how it slipped between my fingers 😄. You can pull v3.0.3 and should be okay!
Describe the bug So we are in the middle of porting our system to V4 and we encountered an issue with the caching mechanism. After upgrading to v3.0.2 when ever
SET_CACHE_RATELIMIT
is set totrue
i get the following error(I redacted info that shouldn't be here :))
To Reproduce Steps to reproduce the behavior:
SET_CACHE_RATELIMIT
set totrue
(We are using a custom redis ICacheprovider implementation but from my tests the failure occurs before it even reaches that point)Expected behavior The library should return the relevant data.
Screenshots Not relevant
Server (please complete the following information):
Additional context After playing around with the code I found out that the headers are returned in a weird format. here is the result from var_dump straight from the call function before the ICacheProvider is even contacted (This is ran with an empty cache so that everything is returned from Riot API).
Notice how instead of a clear string its a nested array and
registerLimits
expects the headers to be strings and not arrays.