for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the League\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace League\Fractal\Serializer;
class DataArraySerializer extends ArraySerializer
{
/**
* Serialize a collection.
* @param string $resourceKey
* @param array $data
* @return array
public function collection($resourceKey, array $data)
return ['data' => $data];
}
* Serialize an item.
public function item($resourceKey, array $data)
* Serialize null resource.
public function null()
return ['data' => []];