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

@ -10,42 +10,25 @@ use Pterodactyl\Exceptions\Service\Deployment\NoViableAllocationException;
class AllocationSelectionService
{
/**
* @var \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface
*/
private $repository;
protected bool $dedicated = false;
/**
* @var bool
*/
protected $dedicated = false;
protected array $nodes = [];
/**
* @var array
*/
protected $nodes = [];
/**
* @var array
*/
protected $ports = [];
protected array $ports = [];
/**
* AllocationSelectionService constructor.
*/
public function __construct(AllocationRepositoryInterface $repository)
public function __construct(private AllocationRepositoryInterface $repository)
{
$this->repository = $repository;
}
/**
* Toggle if the selected allocation should be the only allocation belonging
* to the given IP address. If true an allocation will not be selected if an IP
* already has another server set to use on if its allocations.
*
* @return $this
*/
public function setDedicated(bool $dedicated)
public function setDedicated(bool $dedicated): self
{
$this->dedicated = $dedicated;
@ -55,10 +38,8 @@ class AllocationSelectionService
/**
* A list of node IDs that should be used when selecting an allocation. If empty, all
* nodes will be used to filter with.
*
* @return $this
*/
public function setNodes(array $nodes)
public function setNodes(array $nodes): self
{
$this->nodes = $nodes;
@ -70,11 +51,9 @@ class AllocationSelectionService
* empty, all ports will be considered when finding an allocation. If set, only ports appearing
* in the array or range will be used.
*
* @return $this
*
* @throws \Pterodactyl\Exceptions\DisplayException
*/
public function setPorts(array $ports)
public function setPorts(array $ports): self
{
$stored = [];
foreach ($ports as $port) {