Fix fractal errors
This commit is contained in:
parent
530558b0f8
commit
8c63eebf13
3 changed files with 6 additions and 21 deletions
|
@ -8,12 +8,8 @@ class PterodactylSerializer extends ArraySerializer
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Serialize an item.
|
* Serialize an item.
|
||||||
*
|
|
||||||
* @param string $resourceKey
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function item($resourceKey, array $data)
|
public function item(?string $resourceKey, array $data): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'object' => $resourceKey,
|
'object' => $resourceKey,
|
||||||
|
@ -23,12 +19,8 @@ class PterodactylSerializer extends ArraySerializer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serialize a collection.
|
* Serialize a collection.
|
||||||
*
|
|
||||||
* @param string $resourceKey
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function collection($resourceKey, array $data)
|
public function collection(?string $resourceKey, array $data): array
|
||||||
{
|
{
|
||||||
$response = [];
|
$response = [];
|
||||||
foreach ($data as $datum) {
|
foreach ($data as $datum) {
|
||||||
|
@ -43,10 +35,8 @@ class PterodactylSerializer extends ArraySerializer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serialize a null resource.
|
* Serialize a null resource.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function null()
|
public function null(): ?array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'object' => 'null_resource',
|
'object' => 'null_resource',
|
||||||
|
@ -56,13 +46,8 @@ class PterodactylSerializer extends ArraySerializer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge the included resources with the parent resource being serialized.
|
* Merge the included resources with the parent resource being serialized.
|
||||||
*
|
|
||||||
* @param array $transformedData
|
|
||||||
* @param array $includedData
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function mergeIncludes($transformedData, $includedData)
|
public function mergeIncludes(array $transformedData, array $includedData): array
|
||||||
{
|
{
|
||||||
foreach ($includedData as $key => $datum) {
|
foreach ($includedData as $key => $datum) {
|
||||||
$transformedData['relationships'][$key] = $datum;
|
$transformedData['relationships'][$key] = $datum;
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ScheduleTransformer extends BaseClientTransformer
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $defaultIncludes = ['tasks'];
|
protected array $defaultIncludes = ['tasks'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ServerTransformer extends BaseClientTransformer
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $defaultIncludes = ['allocations', 'variables'];
|
protected array $defaultIncludes = ['allocations', 'variables'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
|
|
Loading…
Reference in a new issue