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.
|
||||
*
|
||||
* @param string $resourceKey
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function item($resourceKey, array $data)
|
||||
public function item(?string $resourceKey, array $data): array
|
||||
{
|
||||
return [
|
||||
'object' => $resourceKey,
|
||||
|
@ -23,12 +19,8 @@ class PterodactylSerializer extends ArraySerializer
|
|||
|
||||
/**
|
||||
* Serialize a collection.
|
||||
*
|
||||
* @param string $resourceKey
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function collection($resourceKey, array $data)
|
||||
public function collection(?string $resourceKey, array $data): array
|
||||
{
|
||||
$response = [];
|
||||
foreach ($data as $datum) {
|
||||
|
@ -43,10 +35,8 @@ class PterodactylSerializer extends ArraySerializer
|
|||
|
||||
/**
|
||||
* Serialize a null resource.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function null()
|
||||
public function null(): ?array
|
||||
{
|
||||
return [
|
||||
'object' => 'null_resource',
|
||||
|
@ -56,13 +46,8 @@ class PterodactylSerializer extends ArraySerializer
|
|||
|
||||
/**
|
||||
* 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) {
|
||||
$transformedData['relationships'][$key] = $datum;
|
||||
|
|
|
@ -16,7 +16,7 @@ class ScheduleTransformer extends BaseClientTransformer
|
|||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultIncludes = ['tasks'];
|
||||
protected array $defaultIncludes = ['tasks'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -16,7 +16,7 @@ class ServerTransformer extends BaseClientTransformer
|
|||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
protected $defaultIncludes = ['allocations', 'variables'];
|
||||
protected array $defaultIncludes = ['allocations', 'variables'];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
Loading…
Reference in a new issue