Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -4,7 +4,9 @@ namespace Pterodactyl\Transformers\Api\Application;
|
|||
|
||||
use Pterodactyl\Models\Node;
|
||||
use Pterodactyl\Models\Server;
|
||||
use League\Fractal\Resource\Item;
|
||||
use Pterodactyl\Models\Allocation;
|
||||
use League\Fractal\Resource\NullResource;
|
||||
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
||||
|
||||
class AllocationTransformer extends BaseTransformer
|
||||
|
@ -24,10 +26,8 @@ class AllocationTransformer extends BaseTransformer
|
|||
|
||||
/**
|
||||
* Return a generic transformed allocation array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Allocation $allocation)
|
||||
public function transform(Allocation $allocation): array
|
||||
{
|
||||
return [
|
||||
'id' => $allocation->id,
|
||||
|
@ -42,11 +42,9 @@ class AllocationTransformer extends BaseTransformer
|
|||
/**
|
||||
* Load the node relationship onto a given transformation.
|
||||
*
|
||||
* @return \League\Fractal\Resource\Item|\League\Fractal\Resource\NullResource
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException
|
||||
*/
|
||||
public function includeNode(Allocation $allocation)
|
||||
public function includeNode(Allocation $allocation): Item|NullResource
|
||||
{
|
||||
if (!$this->authorize(AdminAcl::RESOURCE_NODES)) {
|
||||
return $this->null();
|
||||
|
@ -62,11 +60,9 @@ class AllocationTransformer extends BaseTransformer
|
|||
/**
|
||||
* Load the server relationship onto a given transformation.
|
||||
*
|
||||
* @return \League\Fractal\Resource\Item|\League\Fractal\Resource\NullResource
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException
|
||||
*/
|
||||
public function includeServer(Allocation $allocation)
|
||||
public function includeServer(Allocation $allocation): Item|NullResource
|
||||
{
|
||||
if (!$this->authorize(AdminAcl::RESOURCE_SERVERS) || !$allocation->server) {
|
||||
return $this->null();
|
||||
|
|
Reference in a new issue