mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
23 lines
403 B
PHP
23 lines
403 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Helpers;
|
||
|
|
||
|
use App\Providers\SerializerFactory;
|
||
|
|
||
|
class ScraperHelper
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param object|array $response
|
||
|
* @return array
|
||
|
*/
|
||
|
public static function getSerializedJSON(object|array $response): array
|
||
|
{
|
||
|
return \json_decode(
|
||
|
SerializerFactory::createV4()
|
||
|
->serialize($response, 'json'),
|
||
|
true
|
||
|
);
|
||
|
}
|
||
|
}
|