Update doc blocks for all app/

This commit is contained in:
Dane Everitt 2017-03-19 19:36:50 -04:00
parent 5e27772fef
commit 0312c974f5
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
114 changed files with 1360 additions and 949 deletions

View file

@ -30,19 +30,32 @@ use Pterodactyl\Exceptions\DisplayException;
class CommandRepository
{
/**
* The Eloquent Model associated with the requested server.
*
* @var \Pterodactyl\Models\Server
*/
protected $server;
/**
* Constuctor for repository.
*
* @param int|\Pterodactyl\Models\Server $server
* @return void
*/
public function __construct($server)
{
$this->server = ($server instanceof Models\Server) ? $server : Models\Server::findOrFail($server);
}
/**
* [send description].
* @param string $command
* @return bool
* @throws DisplayException
* @throws RequestException
* Sends a command to the daemon.
*
* @param string $command
* @return string
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws \GuzzleHttp\Exception\RequestException
*/
public function send($command)
{

View file

@ -35,14 +35,15 @@ class FileRepository
/**
* The Eloquent Model associated with the requested server.
*
* @var \Illuminate\Database\Eloquent\Model
* @var \Pterodactyl\Models\Server
*/
protected $server;
/**
* Constructor.
*
* @param string $server The server Short UUID
* @param string $uuid
* @return void
*/
public function __construct($uuid)
{
@ -52,8 +53,11 @@ class FileRepository
/**
* Get the contents of a requested file for the server.
*
* @param string $file
* @param string $file
* @return array
*
* @throws \GuzzleHttp\Exception\RequestException
* @throws \Pterodactyl\Exceptions\DisplayException
*/
public function returnFileContents($file)
{
@ -95,9 +99,12 @@ class FileRepository
/**
* Save the contents of a requested file on the daemon.
*
* @param string $file
* @param string $content
* @param string $file
* @param string $content
* @return bool
*
* @throws \GuzzleHttp\Exception\RequestException
* @throws \Pterodactyl\Exceptions\DisplayException
*/
public function saveFileContents($file, $content)
{
@ -125,8 +132,11 @@ class FileRepository
/**
* Returns a listing of all files and folders within a specified directory on the daemon.
*
* @param string $directory
* @param string $directory
* @return object
*
* @throws \GuzzleHttp\Exception\RequestException
* @throws \Pterodactyl\Exceptions\DisplayException
*/
public function returnDirectoryListing($directory)
{

View file

@ -29,13 +29,33 @@ use Pterodactyl\Exceptions\DisplayException;
class PowerRepository
{
/**
* The Eloquent Model associated with the requested server.
*
* @var \Pterodactyl\Models\Server
*/
protected $server;
/**
* Constuctor for repository.
*
* @param int|\Pterodactyl\Models\Server $server
* @return void
*/
public function __construct($server)
{
$this->server = ($server instanceof Models\Server) ? $server : Models\Server::findOrFail($server);
}
/**
* Sends a power option to the daemon.
*
* @param string $action
* @return string
*
* @throws \GuzzleHttp\Exception\RequestException
* @throws \Pterodactyl\Exceptions\DisplayException
*/
public function do($action)
{
// We don't use the user's specific daemon secret here since we
@ -58,21 +78,41 @@ class PowerRepository
}
}
/**
* Starts a server.
*
* @return void
*/
public function start()
{
$this->do('start');
}
/**
* Stops a server.
*
* @return void
*/
public function stop()
{
$this->do('stop');
}
/**
* Restarts a server.
*
* @return void
*/
public function restart()
{
$this->do('restart');
}
/**
* Kills a server.
*
* @return void
*/
public function kill()
{
$this->do('kill');