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. * 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;

View file

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

View file

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