Add endpoints to return a server's egg configuration

This commit is contained in:
Dane Everitt 2019-09-22 15:30:53 -07:00
parent 5df46b23d2
commit 67ff67a1bd
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 309 additions and 106 deletions

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\User;
use Webmozart\Assert\Assert;
use Pterodactyl\Models\Server;
use Illuminate\Container\Container;
use Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException;
use Pterodactyl\Transformers\Api\Application\BaseTransformer as BaseApplicationTransformer;
@ -63,7 +64,9 @@ abstract class BaseClientTransformer extends BaseApplicationTransformer
*/
protected function makeTransformer(string $abstract, array $parameters = [])
{
$transformer = parent::makeTransformer($abstract, $parameters);
/** @var \Pterodactyl\Transformers\Api\Application\BaseTransformer $transformer */
$transformer = Container::getInstance()->makeWith($abstract, $parameters);
$transformer->setKey($this->getKey());
if (! $transformer instanceof self) {
throw new InvalidTransformerLevelException('Calls to ' . __METHOD__ . ' must return a transformer that is an instance of ' . __CLASS__);