Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -1,13 +1,5 @@
|
|||
<?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\Console\Commands\Node;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
@ -15,14 +7,6 @@ use Pterodactyl\Services\Nodes\NodeCreationService;
|
|||
|
||||
class MakeNodeCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @var \Pterodactyl\Services\Nodes\NodeCreationService
|
||||
*/
|
||||
protected $creationService;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'p:node:make
|
||||
{--name= : A name to identify the node.}
|
||||
{--description= : A description to identify the node.}
|
||||
|
@ -41,20 +25,23 @@ class MakeNodeCommand extends Command
|
|||
{--daemonSFTPPort= : Enter the wings SFTP listening port.}
|
||||
{--daemonBase= : Enter the base folder.}';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Creates a new node on the system via the CLI.';
|
||||
|
||||
/**
|
||||
* MakeNodeCommand constructor.
|
||||
*/
|
||||
public function __construct(private NodeCreationService $creationService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the command execution process.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function handle(NodeCreationService $creationService)
|
||||
public function handle()
|
||||
{
|
||||
$this->creationService = $creationService;
|
||||
|
||||
$data['name'] = $this->option('name') ?? $this->ask('Enter a short identifier used to distinguish this node from others');
|
||||
$data['description'] = $this->option('description') ?? $this->ask('Enter a description to identify the node');
|
||||
$data['location_id'] = $this->option('locationId') ?? $this->ask('Enter a valid location id');
|
||||
|
|
|
@ -13,7 +13,7 @@ class NodeConfigurationCommand extends Command
|
|||
|
||||
protected $description = 'Displays the configuration for the specified node.';
|
||||
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
$column = ctype_digit((string) $this->argument('node')) ? 'id' : 'uuid';
|
||||
|
||||
|
@ -28,7 +28,7 @@ class NodeConfigurationCommand extends Command
|
|||
if (!in_array($format, ['yaml', 'yml', 'json'])) {
|
||||
$this->error('Invalid format specified. Valid options are "yaml" and "json".');
|
||||
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($format === 'json') {
|
||||
|
|
|
@ -9,7 +9,7 @@ class NodeListCommand extends Command
|
|||
{
|
||||
protected $signature = 'p:node:list {--format=text : The output format: "text" or "json". }';
|
||||
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
$nodes = Node::query()->with('location')->get()->map(function (Node $node) {
|
||||
return [
|
||||
|
|
Reference in a new issue