@@ -207,7 +207,7 @@ private function handleAllowListDecisions(array $allowlists): array
207207 }
208208 }
209209 } catch (\Exception $ e ) {
210- $ this ->logger ->info ('Something went wrong during list decisions process ' , [
210+ $ this ->logger ->info ('Something went wrong during allowlists decisions process ' , [
211211 'type ' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS ' ,
212212 'message ' => $ e ->getMessage (),
213213 'code ' => $ e ->getCode (),
@@ -232,15 +232,19 @@ private function handleAllowListResponse(string $listResponse, array $allowDecis
232232 {
233233 $ decisions = [];
234234 $ listedAllows = explode (\PHP_EOL , $ listResponse );
235- $ this ->logger ->debug ('Handle allow list decisions ' , [
235+ $ this ->logger ->debug ('Handle allowlists decisions ' , [
236236 'type ' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS ' ,
237237 'list_count ' => count ($ listedAllows ),
238238 ]);
239239 foreach ($ listedAllows as $ listedAllow ) {
240240 $ decoded = json_decode ($ listedAllow , true );
241241 $ allowDecision ['value ' ] = $ decoded ['value ' ];
242242 $ allowDecision ['scope ' ] = $ decoded ['scope ' ];
243- $ allowDecision ['duration ' ] = '1s ' ; // Will be overwritten by the duration in the allowlist
243+ /*
244+ * This hardcoded value ill be overwritten below by the duration in the allowlist.
245+ * We have to set it to avoid an exception from the convertRawDecision method.
246+ */
247+ $ allowDecision ['duration ' ] = '1s ' ;
244248 $ decision = $ this ->convertRawDecision ($ allowDecision );
245249
246250 if ($ decision ) {
@@ -317,7 +321,7 @@ private function handleListDecisions(array $blocklists): array
317321 }
318322 }
319323 } catch (\Exception $ e ) {
320- $ this ->logger ->info ('Something went wrong during list decisions process ' , [
324+ $ this ->logger ->info ('Something went wrong during blocklists decisions process ' , [
321325 'type ' => 'CAPI_REM_HANDLE_LIST_DECISIONS ' ,
322326 'message ' => $ e ->getMessage (),
323327 'code ' => $ e ->getCode (),
@@ -351,7 +355,7 @@ private function handleListResponse(string $listResponse, array $blockDecision):
351355 {
352356 $ decisions = [];
353357 $ listedIps = explode (\PHP_EOL , $ listResponse );
354- $ this ->logger ->debug ('Handle list decisions ' , [
358+ $ this ->logger ->debug ('Handle blocklist decisions ' , [
355359 'type ' => 'CAPI_REM_HANDLE_LIST_DECISIONS ' ,
356360 'list_count ' => count ($ listedIps ),
357361 ]);
0 commit comments