Cleaned up code to make it OOP.

This commit is contained in:
2023-09-10 19:47:48 -04:00
parent 00ccd2c902
commit b25535ba5f
3 changed files with 121 additions and 153 deletions

View File

@@ -232,4 +232,17 @@ class Module
return $curl;
}
/**
* Decodes a response from JSON into an associative array.
*
* @param string $response
*
* @return array
* @throws \JsonException
*/
public function decodeResponseFromJson(string $response): array
{
return json_decode($response, true, 512, JSON_THROW_ON_ERROR);
}
}