mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Refactor how repositories for the daemon work.
This commit is contained in:
@@ -1,26 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Repositories\Daemon;
|
||||
|
||||
use Webmozart\Assert\Assert;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface;
|
||||
|
||||
class CommandRepository extends BaseRepository implements CommandRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* Send a command to a server.
|
||||
*
|
||||
* @param string $command
|
||||
* @return \Psr\Http\Message\ResponseInterface
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function send($command)
|
||||
public function send(string $command): ResponseInterface
|
||||
{
|
||||
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
|
||||
|
||||
return $this->getHttpClient()->request('POST', 'server/command', [
|
||||
'json' => [
|
||||
'command' => $command,
|
||||
|
||||
Reference in New Issue
Block a user