2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Serializers;
|
2015-11-01 23:10:20 +01:00
|
|
|
|
|
|
|
use League\Fractal\Serializer\ArraySerializer as FractalArraySerializer;
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
2017-01-30 20:40:43 +01:00
|
|
|
* Class ArraySerializer.
|
2016-07-03 18:11:58 +02:00
|
|
|
*/
|
2015-11-01 23:10:20 +01:00
|
|
|
class ArraySerializer extends FractalArraySerializer
|
|
|
|
{
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @param string $resourceKey
|
2017-01-30 20:40:43 +01:00
|
|
|
* @param array $data
|
|
|
|
*
|
2016-07-03 18:11:58 +02:00
|
|
|
* @return array
|
|
|
|
*/
|
2015-11-01 23:10:20 +01:00
|
|
|
public function collection($resourceKey, array $data)
|
|
|
|
{
|
2015-12-14 21:07:48 +01:00
|
|
|
return $data;
|
2015-11-01 23:10:20 +01:00
|
|
|
}
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @param string $resourceKey
|
2017-01-30 20:40:43 +01:00
|
|
|
* @param array $data
|
|
|
|
*
|
2016-07-03 18:11:58 +02:00
|
|
|
* @return array
|
|
|
|
*/
|
2015-11-01 23:10:20 +01:00
|
|
|
public function item($resourceKey, array $data)
|
|
|
|
{
|
2015-12-14 21:07:48 +01:00
|
|
|
return $data;
|
2015-11-01 23:10:20 +01:00
|
|
|
}
|
|
|
|
}
|