2019-03-28 22:35:35 +01:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2019-03-28 22:35:35 +01:00
|
|
|
|
|
|
|
namespace App\Transformers;
|
|
|
|
|
|
|
|
use League\Fractal\Serializer\ArraySerializer as FractalArraySerializer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ArraySerializer.
|
|
|
|
*/
|
|
|
|
class ArraySerializer extends FractalArraySerializer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param string $resourceKey
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2023-08-21 03:29:31 +02:00
|
|
|
public function collection(?string $resourceKey, array $data): array
|
2019-03-28 22:35:35 +01:00
|
|
|
{
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $resourceKey
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2023-08-21 03:29:31 +02:00
|
|
|
public function item(?string $resourceKey, array $data): array
|
2019-03-28 22:35:35 +01:00
|
|
|
{
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|