Fix fractal errors

This commit is contained in:
DaneEveritt 2022-05-04 19:35:10 -04:00
parent 530558b0f8
commit 8c63eebf13
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 6 additions and 21 deletions

View file

@ -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;

View file

@ -16,7 +16,7 @@ class ScheduleTransformer extends BaseClientTransformer
/**
* @var array
*/
protected $defaultIncludes = ['tasks'];
protected array $defaultIncludes = ['tasks'];
/**
* {@inheritdoc}

View file

@ -16,7 +16,7 @@ class ServerTransformer extends BaseClientTransformer
/**
* @var string[]
*/
protected $defaultIncludes = ['allocations', 'variables'];
protected array $defaultIncludes = ['allocations', 'variables'];
/**
* @var array