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

@ -15,30 +15,16 @@ use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest;
class ServerInstallController extends Controller
{
/**
* @var \Pterodactyl\Repositories\Eloquent\ServerRepository
*/
private $repository;
/**
* @var \Illuminate\Contracts\Events\Dispatcher
*/
private $eventDispatcher;
/**
* ServerInstallController constructor.
*/
public function __construct(ServerRepository $repository, EventDispatcher $eventDispatcher)
public function __construct(private ServerRepository $repository, private EventDispatcher $eventDispatcher)
{
$this->repository = $repository;
$this->eventDispatcher = $eventDispatcher;
}
/**
* Returns installation information for a server.
*
* @return \Illuminate\Http\JsonResponse
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function index(Request $request, string $uuid): JsonResponse
@ -56,8 +42,6 @@ class ServerInstallController extends Controller
/**
* Updates the installation state of a server.
*
* @return \Illuminate\Http\JsonResponse
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
@ -77,7 +61,7 @@ class ServerInstallController extends Controller
$isInitialInstall = is_null($server->installed_at);
if ($isInitialInstall && config()->get('pterodactyl.email.send_install_notification', true)) {
$this->eventDispatcher->dispatch(new ServerInstalled($server));
} elseif (! $isInitialInstall && config()->get('pterodactyl.email.send_reinstall_notification', true)) {
} elseif (!$isInitialInstall && config()->get('pterodactyl.email.send_reinstall_notification', true)) {
$this->eventDispatcher->dispatch(new ServerInstalled($server));
}