Attempt to fix Fractal object type being null

This commit is contained in:
Matthew Penner 2022-12-14 19:13:00 -07:00
parent 507a802dec
commit 8fff0846a0
No known key found for this signature in database
3 changed files with 47 additions and 36 deletions

View file

@ -6,17 +6,6 @@ use League\Fractal\Serializer\ArraySerializer;
class PterodactylSerializer extends ArraySerializer
{
/**
* Serialize an item.
*/
public function item(?string $resourceKey, array $data): array
{
return [
'object' => $resourceKey,
'attributes' => $data,
];
}
/**
* Serialize a collection.
*/
@ -33,6 +22,17 @@ class PterodactylSerializer extends ArraySerializer
];
}
/**
* Serialize an item.
*/
public function item(?string $resourceKey, array $data): array
{
return [
'object' => $resourceKey,
'attributes' => $data,
];
}
/**
* Serialize a null resource.
*/