Refactor how repositories for the daemon work.

This commit is contained in:
Dane Everitt 2018-01-05 18:27:47 -06:00
parent 5f9fe4a69b
commit d2afc29a80
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
58 changed files with 388 additions and 997 deletions

View file

@ -1,35 +1,31 @@
<?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\Contracts\Repository\Daemon;
use stdClass;
use Psr\Http\Message\ResponseInterface;
interface FileRepositoryInterface extends BaseRepositoryInterface
{
/**
* Return stat information for a given file.
*
* @param string $path
* @return object
* @return \stdClass
*
* @throws \GuzzleHttp\Exception\RequestException
*/
public function getFileStat($path);
public function getFileStat(string $path): stdClass;
/**
* Return the contents of a given file if it can be edited in the Panel.
*
* @param string $path
* @return object
* @return \stdClass
*
* @throws \GuzzleHttp\Exception\RequestException
*/
public function getContent($path);
public function getContent(string $path): stdClass;
/**
* Save new contents to a given file.
@ -40,7 +36,7 @@ interface FileRepositoryInterface extends BaseRepositoryInterface
*
* @throws \GuzzleHttp\Exception\RequestException
*/
public function putContent($path, $content);
public function putContent(string $path, string $content): ResponseInterface;
/**
* Return a directory listing for a given path.
@ -50,5 +46,5 @@ interface FileRepositoryInterface extends BaseRepositoryInterface
*
* @throws \GuzzleHttp\Exception\RequestException
*/
public function getDirectory($path);
public function getDirectory(string $path): array;
}