Use a standardized transformer base; replace all client transformers to call that base

This commit is contained in:
Dane Everitt 2021-08-07 13:06:45 -07:00
parent 2203a4d87e
commit cf500a1a54
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
25 changed files with 255 additions and 379 deletions

View file

@ -3,23 +3,19 @@
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\User;
use Pterodactyl\Transformers\Api\Transformer;
class AccountTransformer extends BaseClientTransformer
class AccountTransformer extends Transformer
{
/**
* Return the resource name for the JSONAPI output.
*/
public function getResourceName(): string
{
return 'user';
return User::RESOURCE_NAME;
}
/**
* Return basic information about the currently logged in user.
*
* @return array
*/
public function transform(User $model)
public function transform(User $model): array
{
return [
'id' => $model->id,