Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -32,8 +32,6 @@ class AllocationSelectionService
|
|||
|
||||
/**
|
||||
* AllocationSelectionService constructor.
|
||||
*
|
||||
* @param \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface $repository
|
||||
*/
|
||||
public function __construct(AllocationRepositoryInterface $repository)
|
||||
{
|
||||
|
@ -45,7 +43,6 @@ class AllocationSelectionService
|
|||
* 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.
|
||||
*
|
||||
* @param bool $dedicated
|
||||
* @return $this
|
||||
*/
|
||||
public function setDedicated(bool $dedicated)
|
||||
|
@ -59,7 +56,6 @@ 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.
|
||||
*
|
||||
* @param array $nodes
|
||||
* @return $this
|
||||
*/
|
||||
public function setNodes(array $nodes)
|
||||
|
@ -74,7 +70,6 @@ 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.
|
||||
*
|
||||
* @param array $ports
|
||||
* @return $this
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
|
@ -106,8 +101,6 @@ class AllocationSelectionService
|
|||
/**
|
||||
* Return a single allocation that should be used as the default allocation for a server.
|
||||
*
|
||||
* @return \Pterodactyl\Models\Allocation
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Service\Deployment\NoViableAllocationException
|
||||
*/
|
||||
public function handle(): Allocation
|
||||
|
|
|
@ -26,7 +26,6 @@ class FindViableNodesService
|
|||
/**
|
||||
* Set the locations that should be searched through to locate available nodes.
|
||||
*
|
||||
* @param array $locations
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocations(array $locations): self
|
||||
|
@ -43,7 +42,6 @@ class FindViableNodesService
|
|||
* filtered out if they do not have enough available free disk space for this server
|
||||
* to be placed on.
|
||||
*
|
||||
* @param int $disk
|
||||
* @return $this
|
||||
*/
|
||||
public function setDisk(int $disk): self
|
||||
|
@ -57,7 +55,6 @@ class FindViableNodesService
|
|||
* Set the amount of memory that this server will be using. As with disk space, nodes that
|
||||
* do not have enough free memory will be filtered out.
|
||||
*
|
||||
* @param int $memory
|
||||
* @return $this
|
||||
*/
|
||||
public function setMemory(int $memory): self
|
||||
|
@ -81,6 +78,7 @@ class FindViableNodesService
|
|||
* up to 50 nodes at a time starting at the provided page.
|
||||
* If "null" is provided as the value no pagination will
|
||||
* be used.
|
||||
*
|
||||
* @return \Illuminate\Support\Collection|\Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Service\Deployment\NoViableNodeException
|
||||
|
@ -96,7 +94,7 @@ class FindViableNodesService
|
|||
->leftJoin('servers', 'servers.node_id', '=', 'nodes.id')
|
||||
->where('nodes.public', 1);
|
||||
|
||||
if (! empty($this->locations)) {
|
||||
if (!empty($this->locations)) {
|
||||
$query = $query->whereIn('nodes.location_id', $this->locations);
|
||||
}
|
||||
|
||||
|
@ -104,7 +102,7 @@ class FindViableNodesService
|
|||
->havingRaw('(IFNULL(SUM(servers.memory), 0) + ?) <= (nodes.memory * (1 + (nodes.memory_overallocate / 100)))', [$this->memory])
|
||||
->havingRaw('(IFNULL(SUM(servers.disk), 0) + ?) <= (nodes.disk * (1 + (nodes.disk_overallocate / 100)))', [$this->disk]);
|
||||
|
||||
if (! is_null($page)) {
|
||||
if (!is_null($page)) {
|
||||
$results = $results->paginate(50, ['*'], 'page', $page);
|
||||
} else {
|
||||
$results = $results->get()->toBase();
|
||||
|
|
Reference in a new issue