php-cs-fixer and phpstan
This commit is contained in:
parent
363c4fd49f
commit
7ed2be50fd
25 changed files with 102 additions and 109 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue