Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -18,31 +18,18 @@ use Pterodactyl\Http\Requests\Api\Application\Allocations\DeleteAllocationReques
class AllocationController extends ApplicationApiController
{
/**
* @var \Pterodactyl\Services\Allocations\AssignmentService
*/
private $assignmentService;
/**
* @var \Pterodactyl\Services\Allocations\AllocationDeletionService
*/
private $deletionService;
/**
* AllocationController constructor.
*/
public function __construct(
AssignmentService $assignmentService,
AllocationDeletionService $deletionService
private AssignmentService $assignmentService,
private AllocationDeletionService $deletionService
) {
parent::__construct();
$this->assignmentService = $assignmentService;
$this->deletionService = $deletionService;
}
/**
* Return all of the allocations that exist for a given node.
* Return all the allocations that exist for a given node.
*/
public function index(GetAllocationsRequest $request, Node $node): array
{

View file

@ -13,10 +13,8 @@ class NodeConfigurationController extends ApplicationApiController
* Returns the configuration information for a node. This allows for automated deployments
* to remote machines so long as an API key is provided to the machine to make the request
* with, and the node is known.
*
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(GetNodeRequest $request, Node $node)
public function __invoke(GetNodeRequest $request, Node $node): JsonResponse
{
return new JsonResponse($node->getConfiguration());
}

View file

@ -8,7 +8,6 @@ use Spatie\QueryBuilder\QueryBuilder;
use Pterodactyl\Services\Nodes\NodeUpdateService;
use Pterodactyl\Services\Nodes\NodeCreationService;
use Pterodactyl\Services\Nodes\NodeDeletionService;
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
use Pterodactyl\Transformers\Api\Application\NodeTransformer;
use Pterodactyl\Http\Requests\Api\Application\Nodes\GetNodeRequest;
use Pterodactyl\Http\Requests\Api\Application\Nodes\GetNodesRequest;
@ -19,45 +18,19 @@ use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
class NodeController extends ApplicationApiController
{
/**
* @var \Pterodactyl\Services\Nodes\NodeCreationService
*/
private $creationService;
/**
* @var \Pterodactyl\Services\Nodes\NodeDeletionService
*/
private $deletionService;
/**
* @var \Pterodactyl\Contracts\Repository\NodeRepositoryInterface
*/
private $repository;
/**
* @var \Pterodactyl\Services\Nodes\NodeUpdateService
*/
private $updateService;
/**
* NodeController constructor.
*/
public function __construct(
NodeCreationService $creationService,
NodeDeletionService $deletionService,
NodeUpdateService $updateService,
NodeRepositoryInterface $repository
private NodeCreationService $creationService,
private NodeDeletionService $deletionService,
private NodeUpdateService $updateService
) {
parent::__construct();
$this->repository = $repository;
$this->creationService = $creationService;
$this->deletionService = $deletionService;
$this->updateService = $updateService;
}
/**
* Return all of the nodes currently available on the Panel.
* Return all the nodes currently available on the Panel.
*/
public function index(GetNodesRequest $request): array
{
@ -82,7 +55,7 @@ class NodeController extends ApplicationApiController
}
/**
* Create a new node on the Panel. Returns the created node and a HTTP/201
* Create a new node on the Panel. Returns the created node and an HTTP/201
* status response on success.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException

View file

@ -9,19 +9,12 @@ use Pterodactyl\Http\Requests\Api\Application\Nodes\GetDeployableNodesRequest;
class NodeDeploymentController extends ApplicationApiController
{
/**
* @var \Pterodactyl\Services\Deployment\FindViableNodesService
*/
private $viableNodesService;
/**
* NodeDeploymentController constructor.
*/
public function __construct(FindViableNodesService $viableNodesService)
public function __construct(private FindViableNodesService $viableNodesService)
{
parent::__construct();
$this->viableNodesService = $viableNodesService;
}
/**