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

@ -19,8 +19,6 @@ class GetServerDatabaseRequest extends ApplicationApiRequest
/**
* Determine if the requested server database exists.
*
* @return bool
*/
public function resourceExists(): bool
{

View file

@ -24,8 +24,6 @@ class StoreServerDatabaseRequest extends ApplicationApiRequest
/**
* Validation rules for database creation.
*
* @return array
*/
public function rules(): array
{
@ -76,8 +74,6 @@ class StoreServerDatabaseRequest extends ApplicationApiRequest
/**
* Returns the database name in the expected format.
*
* @return string
*/
public function databaseName(): string
{

View file

@ -27,8 +27,6 @@ class GetExternalServerRequest extends ApplicationApiRequest
/**
* Determine if the requested external user exists.
*
* @return bool
*/
public function resourceExists(): bool
{
@ -47,8 +45,6 @@ class GetExternalServerRequest extends ApplicationApiRequest
/**
* Return the server model for the requested external server.
*
* @return \Pterodactyl\Models\Server
*/
public function getServerModel(): Server
{

View file

@ -4,9 +4,6 @@ namespace Pterodactyl\Http\Requests\Api\Application\Servers;
class GetServersRequest extends GetServerRequest
{
/**
* @return array
*/
public function rules(): array
{
return [

View file

@ -23,8 +23,6 @@ class StoreServerRequest extends ApplicationApiRequest
/**
* Rules to be applied to this request.
*
* @return array
*/
public function rules(): array
{
@ -120,7 +118,7 @@ class StoreServerRequest extends ApplicationApiRequest
$query->whereNull('server_id');
}),
], function ($input) {
return ! ($input->deploy);
return !($input->deploy);
});
$validator->sometimes('allocation.additional.*', [
@ -129,7 +127,7 @@ class StoreServerRequest extends ApplicationApiRequest
$query->whereNull('server_id');
}),
], function ($input) {
return ! ($input->deploy);
return !($input->deploy);
});
$validator->sometimes('deploy.locations', 'present', function ($input) {
@ -152,7 +150,7 @@ class StoreServerRequest extends ApplicationApiRequest
return null;
}
$object = new DeploymentObject;
$object = new DeploymentObject();
$object->setDedicated($this->input('deploy.dedicated_ip', false));
$object->setLocations($this->input('deploy.locations', []));
$object->setPorts($this->input('deploy.port_range', []));

View file

@ -9,8 +9,6 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest
{
/**
* Return the rules to validate this request against.
*
* @return array
*/
public function rules(): array
{
@ -67,7 +65,7 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest
unset($data['allocation'], $data['feature_limits']);
// Adjust the limits field to match what is expected by the model.
if (! empty($data['limits'])) {
if (!empty($data['limits'])) {
foreach ($data['limits'] as $key => $value) {
$data[$key] = $value;
}
@ -101,16 +99,13 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest
* compatability with the old API endpoint while also supporting a more correct API
* call.
*
* @param string $field
* @param array $rules
* @param bool $limits
* @return array
*
* @see https://github.com/pterodactyl/panel/issues/1500
*/
protected function requiredToOptional(string $field, array $rules, bool $limits = false)
{
if (! in_array('required', $rules)) {
if (!in_array('required', $rules)) {
return $rules;
}

View file

@ -8,8 +8,6 @@ class UpdateServerDetailsRequest extends ServerWriteRequest
{
/**
* Rules to apply to a server details update request.
*
* @return array
*/
public function rules(): array
{
@ -26,8 +24,6 @@ class UpdateServerDetailsRequest extends ServerWriteRequest
/**
* Convert the posted data into the correct format that is expected
* by the application.
*
* @return array
*/
public function validated(): array
{
@ -42,8 +38,6 @@ class UpdateServerDetailsRequest extends ServerWriteRequest
/**
* Rename some of the attributes in error messages to clarify the field
* being discussed.
*
* @return array
*/
public function attributes(): array
{

View file

@ -20,8 +20,6 @@ class UpdateServerStartupRequest extends ApplicationApiRequest
/**
* Validation rules to run the input against.
*
* @return array
*/
public function rules(): array
{