Update repository base code to be cleaner and make use of PHP 7 features

This commit is contained in:
Dane Everitt 2018-01-04 22:49:50 -06:00
parent 0ec5a4e08c
commit 60eb60013c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
96 changed files with 1048 additions and 1785 deletions
app/Contracts/Repository

View file

@ -1,44 +1,26 @@
<?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;
use Pterodactyl\Models\Pack;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Pterodactyl\Contracts\Repository\Attributes\SearchableInterface;
interface PackRepositoryInterface extends RepositoryInterface, SearchableInterface
{
/**
* Return a paginated listing of packs with their associated egg and server count.
*
* @param int $paginate
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/
public function paginateWithEggAndServerCount($paginate = 50);
/**
* Return a pack with the associated server models attached to it.
*
* @param int $id
* @return \Illuminate\Database\Eloquent\Collection
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
* @param \Pterodactyl\Models\Pack $pack
* @param bool $refresh
* @return \Pterodactyl\Models\Pack
*/
public function getWithServers($id);
public function loadServerData(Pack $pack, bool $refresh = false): Pack;
/**
* Return all of the file archives for a given pack.
* Return a paginated listing of packs with their associated egg and server count.
*
* @param int $id
* @param bool $collection
* @return object|\Illuminate\Support\Collection
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/
public function getFileArchives($id, $collection = false);
public function paginateWithEggAndServerCount(): LengthAwarePaginator;
}