php-cs-fixer and phpstan

This commit is contained in:
Matthew Penner 2022-12-14 18:04:16 -07:00
parent 363c4fd49f
commit 7ed2be50fd
No known key found for this signature in database
25 changed files with 102 additions and 109 deletions

View file

@ -2,20 +2,12 @@
namespace Pterodactyl\Transformers\Api\Application;
use League\Fractal\Resource\Item;
use Pterodactyl\Models\EggVariable;
use Pterodactyl\Models\ServerVariable;
use League\Fractal\Resource\NullResource;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Transformers\Api\Transformer;
class ServerVariableTransformer extends Transformer
{
/**
* List of resources that can be included.
*/
protected array $availableIncludes = ['parent'];
/**
* Return the resource name for the JSONAPI output.
*/
@ -31,17 +23,4 @@ class ServerVariableTransformer extends Transformer
{
return $model->toArray();
}
/**
* Return the parent service variable data.
*/
public function includeParent(EggVariable $variable): Item|NullResource
{
if (!$this->authorize(AdminAcl::RESOURCE_EGGS)) {
return $this->null();
}
// TODO: what the fuck?
return $this->item($variable->variable, new EggVariableTransformer());
}
}