Use a standardized transformer base; replace all client transformers to call that base
This commit is contained in:
parent
2203a4d87e
commit
cf500a1a54
25 changed files with 255 additions and 379 deletions
|
@ -4,18 +4,16 @@ namespace Pterodactyl\Transformers\Api\Client;
|
|||
|
||||
use BadMethodCallException;
|
||||
use Pterodactyl\Models\EggVariable;
|
||||
use Pterodactyl\Transformers\Api\Transformer;
|
||||
|
||||
class EggVariableTransformer extends BaseClientTransformer
|
||||
class EggVariableTransformer extends Transformer
|
||||
{
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return EggVariable::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function transform(EggVariable $variable)
|
||||
public function transform(EggVariable $variable): array
|
||||
{
|
||||
// This guards against someone incorrectly retrieving variables (haha, me) and then passing
|
||||
// them into the transformer and along to the user. Just throw an exception and break the entire
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue