Skip to content

Commit 8c63eeb

Browse files
committed
Fix fractal errors
1 parent 530558b commit 8c63eeb

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

app/Extensions/League/Fractal/Serializers/PterodactylSerializer.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ class PterodactylSerializer extends ArraySerializer
88
{
99
/**
1010
* Serialize an item.
11-
*
12-
* @param string $resourceKey
13-
*
14-
* @return array
1511
*/
16-
public function item($resourceKey, array $data)
12+
public function item(?string $resourceKey, array $data): array
1713
{
1814
return [
1915
'object' => $resourceKey,
@@ -23,12 +19,8 @@ public function item($resourceKey, array $data)
2319

2420
/**
2521
* Serialize a collection.
26-
*
27-
* @param string $resourceKey
28-
*
29-
* @return array
3022
*/
31-
public function collection($resourceKey, array $data)
23+
public function collection(?string $resourceKey, array $data): array
3224
{
3325
$response = [];
3426
foreach ($data as $datum) {
@@ -43,10 +35,8 @@ public function collection($resourceKey, array $data)
4335

4436
/**
4537
* Serialize a null resource.
46-
*
47-
* @return array
4838
*/
49-
public function null()
39+
public function null(): ?array
5040
{
5141
return [
5242
'object' => 'null_resource',
@@ -56,13 +46,8 @@ public function null()
5646

5747
/**
5848
* Merge the included resources with the parent resource being serialized.
59-
*
60-
* @param array $transformedData
61-
* @param array $includedData
62-
*
63-
* @return array
6449
*/
65-
public function mergeIncludes($transformedData, $includedData)
50+
public function mergeIncludes(array $transformedData, array $includedData): array
6651
{
6752
foreach ($includedData as $key => $datum) {
6853
$transformedData['relationships'][$key] = $datum;

app/Transformers/Api/Client/ScheduleTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ScheduleTransformer extends BaseClientTransformer
1616
/**
1717
* @var array
1818
*/
19-
protected $defaultIncludes = ['tasks'];
19+
protected array $defaultIncludes = ['tasks'];
2020

2121
/**
2222
* {@inheritdoc}

app/Transformers/Api/Client/ServerTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ServerTransformer extends BaseClientTransformer
1616
/**
1717
* @var string[]
1818
*/
19-
protected $defaultIncludes = ['allocations', 'variables'];
19+
protected array $defaultIncludes = ['allocations', 'variables'];
2020

2121
/**
2222
* @var array

0 commit comments

Comments
 (0)