Merge branch 'develop' into feature/react-admin

This commit is contained in:
Matthew Penner 2021-01-23 14:39:23 -07:00
commit 8feb87de7c
532 changed files with 4262 additions and 5622 deletions

View file

@ -40,8 +40,6 @@ abstract class ApplicationApiRequest extends FormRequest
* Determine if the current user is authorized to perform
* the requested action against the API.
*
* @return bool
*
* @throws \Pterodactyl\Exceptions\PterodactylException
*/
public function authorize(): bool
@ -59,8 +57,6 @@ abstract class ApplicationApiRequest extends FormRequest
/**
* Determine if the requested resource exists on the server.
*
* @return bool
*/
public function resourceExists(): bool
{
@ -69,8 +65,6 @@ abstract class ApplicationApiRequest extends FormRequest
/**
* Default set of rules to apply to API requests.
*
* @return array
*/
public function rules(): array
{
@ -79,8 +73,6 @@ abstract class ApplicationApiRequest extends FormRequest
/**
* Return the API key being used for the request.
*
* @return \Pterodactyl\Models\ApiKey
*/
public function key(): ApiKey
{
@ -91,8 +83,8 @@ abstract class ApplicationApiRequest extends FormRequest
* Grab a model from the route parameters. If no model is found in the
* binding mappings an exception will be thrown.
*
* @param string $model
* @return mixed
*
* @deprecated
*
* @throws \Symfony\Component\Routing\Exception\InvalidParameterException
@ -102,7 +94,7 @@ abstract class ApplicationApiRequest extends FormRequest
$parameterKey = array_get(array_flip(ApiSubstituteBindings::getMappings()), $model);
if (is_null($parameterKey)) {
throw new InvalidParameterException;
throw new InvalidParameterException();
}
return $this->route()->parameter($parameterKey);
@ -116,7 +108,7 @@ abstract class ApplicationApiRequest extends FormRequest
*/
protected function prepareForValidation()
{
if (! $this->passesAuthorization()) {
if (!$this->passesAuthorization()) {
$this->failedAuthorization();
}
@ -141,7 +133,7 @@ abstract class ApplicationApiRequest extends FormRequest
return true;
}
if (! parent::passesAuthorization()) {
if (!parent::passesAuthorization()) {
return false;
}
@ -149,7 +141,7 @@ abstract class ApplicationApiRequest extends FormRequest
// authenticated to access the endpoint. This avoids exposing that
// an item exists (or does not exist) to the user until they can prove
// that they have permission to know about it.
if ($this->attributes->get('is_missing_model', false) || ! $this->resourceExists()) {
if ($this->attributes->get('is_missing_model', false) || !$this->resourceExists()) {
throw new NotFoundHttpException(trans('exceptions.api.resource_not_found'));
}