Use more standardized phpcs

This commit is contained in:
Dane Everitt 2021-01-23 12:33:34 -08:00
parent a043071e3c
commit c449ca5155
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
493 changed files with 1116 additions and 3903 deletions

View file

@ -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();