Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -47,13 +47,6 @@ class CreateServerController extends Controller
|
|||
|
||||
/**
|
||||
* CreateServerController constructor.
|
||||
*
|
||||
* @param \Prologue\Alerts\AlertsMessageBag $alert
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NestRepository $nestRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
|
||||
* @param \Pterodactyl\Services\Servers\ServerCreationService $creationService
|
||||
*/
|
||||
public function __construct(
|
||||
AlertsMessageBag $alert,
|
||||
|
@ -75,6 +68,7 @@ class CreateServerController extends Controller
|
|||
* Displays the create server page.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
|
@ -106,7 +100,6 @@ class CreateServerController extends Controller
|
|||
/**
|
||||
* Create a new server on the remote system.
|
||||
*
|
||||
* @param \Pterodactyl\Http\Requests\Admin\ServerFormRequest $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
|
@ -118,7 +111,7 @@ class CreateServerController extends Controller
|
|||
public function store(ServerFormRequest $request)
|
||||
{
|
||||
$data = $request->except(['_token']);
|
||||
if (! empty($data['custom_image'])) {
|
||||
if (!empty($data['custom_image'])) {
|
||||
$data['image'] = $data['custom_image'];
|
||||
unset($data['custom_image']);
|
||||
}
|
||||
|
|
|
@ -25,9 +25,6 @@ class ServerController extends Controller
|
|||
|
||||
/**
|
||||
* ServerController constructor.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\Factory $view
|
||||
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
|
||||
*/
|
||||
public function __construct(
|
||||
Factory $view,
|
||||
|
@ -41,7 +38,6 @@ class ServerController extends Controller
|
|||
* Returns all of the servers that exist on the system using a paginated result set. If
|
||||
* a query is passed along in the request it is also passed to the repository function.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(Request $request)
|
||||
|
@ -49,7 +45,7 @@ class ServerController extends Controller
|
|||
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
|
||||
->allowedFilters([
|
||||
AllowedFilter::exact('owner_id'),
|
||||
AllowedFilter::custom('*', new AdminServerFilter),
|
||||
AllowedFilter::custom('*', new AdminServerFilter()),
|
||||
])
|
||||
->paginate(config()->get('pterodactyl.paginate.admin.servers'));
|
||||
|
||||
|
|
|
@ -53,14 +53,6 @@ class ServerTransferController extends Controller
|
|||
|
||||
/**
|
||||
* ServerTransferController constructor.
|
||||
*
|
||||
* @param \Prologue\Alerts\AlertsMessageBag $alert
|
||||
* @param \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface $allocationRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
|
||||
* @param \Pterodactyl\Services\Servers\TransferService $transferService
|
||||
* @param \Pterodactyl\Repositories\Wings\DaemonConfigurationRepository $daemonConfigurationRepository
|
||||
*/
|
||||
public function __construct(
|
||||
AlertsMessageBag $alert,
|
||||
|
@ -83,8 +75,6 @@ class ServerTransferController extends Controller
|
|||
/**
|
||||
* Starts a transfer of a server to a new node.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*
|
||||
* @throws \Throwable
|
||||
|
@ -108,7 +98,7 @@ class ServerTransferController extends Controller
|
|||
$this->daemonConfigurationRepository->setNode($node)->getSystemInformation();
|
||||
|
||||
// Create a new ServerTransfer entry.
|
||||
$transfer = new ServerTransfer;
|
||||
$transfer = new ServerTransfer();
|
||||
|
||||
$transfer->server_id = $server->id;
|
||||
$transfer->old_node = $server->node_id;
|
||||
|
@ -136,11 +126,6 @@ class ServerTransferController extends Controller
|
|||
|
||||
/**
|
||||
* Assigns the specified allocations to the specified server.
|
||||
*
|
||||
* @param Server $server
|
||||
* @param int $node_id
|
||||
* @param int $allocation_id
|
||||
* @param array $additional_allocations
|
||||
*/
|
||||
private function assignAllocationsToServer(Server $server, int $node_id, int $allocation_id, array $additional_allocations)
|
||||
{
|
||||
|
@ -151,14 +136,14 @@ class ServerTransferController extends Controller
|
|||
|
||||
$updateIds = [];
|
||||
foreach ($allocations as $allocation) {
|
||||
if (! in_array($allocation, $unassigned)) {
|
||||
if (!in_array($allocation, $unassigned)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$updateIds[] = $allocation;
|
||||
}
|
||||
|
||||
if (! empty($updateIds)) {
|
||||
if (!empty($updateIds)) {
|
||||
$this->allocationRepository->updateWhereIn('id', $updateIds, ['server_id' => $server->id]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,15 +64,6 @@ class ServerViewController extends Controller
|
|||
|
||||
/**
|
||||
* ServerViewController constructor.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\Factory $view
|
||||
* @param \Pterodactyl\Repositories\Eloquent\DatabaseHostRepository $databaseHostRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\MountRepository $mountRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NestRepository $nestRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
|
||||
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
|
||||
* @param \Pterodactyl\Services\Servers\EnvironmentService $environmentService
|
||||
*/
|
||||
public function __construct(
|
||||
Factory $view,
|
||||
|
@ -97,8 +88,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns the index view for a server.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(Request $request, Server $server)
|
||||
|
@ -109,8 +98,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns the server details page.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function details(Request $request, Server $server)
|
||||
|
@ -121,8 +108,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns a view of server build settings.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function build(Request $request, Server $server)
|
||||
|
@ -139,8 +124,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns the server startup management page.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
|
@ -166,8 +149,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns all of the databases that exist for the server.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function database(Request $request, Server $server)
|
||||
|
@ -181,8 +162,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns all of the mounts that exist for the server.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function mounts(Request $request, Server $server)
|
||||
|
@ -199,8 +178,6 @@ class ServerViewController extends Controller
|
|||
* Returns the base server management page, or an exception if the server
|
||||
* is in a state that cannot be recovered from.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
|
@ -208,9 +185,7 @@ class ServerViewController extends Controller
|
|||
public function manage(Request $request, Server $server)
|
||||
{
|
||||
if ($server->installed > 1) {
|
||||
throw new DisplayException(
|
||||
'This server is in a failed install state and cannot be recovered. Please delete and re-create the server.'
|
||||
);
|
||||
throw new DisplayException('This server is in a failed install state and cannot be recovered. Please delete and re-create the server.');
|
||||
}
|
||||
|
||||
// Check if the panel doesn't have at least 2 nodes configured.
|
||||
|
@ -234,8 +209,6 @@ class ServerViewController extends Controller
|
|||
/**
|
||||
* Returns the server deletion page.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function delete(Request $request, Server $server)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue