Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -6,9 +6,6 @@ use Pterodactyl\Models\Permission;
|
|||
|
||||
class DeleteScheduleRequest extends ViewScheduleRequest
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_DELETE;
|
||||
|
|
|
@ -7,17 +7,11 @@ use Pterodactyl\Models\Permission;
|
|||
|
||||
class StoreScheduleRequest extends ViewScheduleRequest
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_CREATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = Schedule::getRules();
|
||||
|
|
|
@ -10,17 +10,12 @@ class StoreTaskRequest extends ViewScheduleRequest
|
|||
* Determine if the user is allowed to create a new task for this schedule. We simply
|
||||
* check if they can modify a schedule to determine if they're able to do this. There
|
||||
* are no task specific permissions.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_UPDATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
@ -7,17 +7,11 @@ use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
|||
|
||||
class TriggerScheduleRequest extends ClientApiRequest
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_UPDATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [];
|
||||
|
|
|
@ -6,9 +6,6 @@ use Pterodactyl\Models\Permission;
|
|||
|
||||
class UpdateScheduleRequest extends StoreScheduleRequest
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_UPDATE;
|
||||
|
|
|
@ -13,12 +13,10 @@ class ViewScheduleRequest extends ClientApiRequest
|
|||
{
|
||||
/**
|
||||
* Determine if this resource can be viewed.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
if (! parent::authorize()) {
|
||||
if (!parent::authorize()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -31,18 +29,13 @@ class ViewScheduleRequest extends ClientApiRequest
|
|||
$task = $this->route()->parameter('task');
|
||||
|
||||
if ($schedule->server_id !== $server->id || ($task instanceof Task && $task->schedule_id !== $schedule->id)) {
|
||||
throw new NotFoundHttpException(
|
||||
'The requested resource does not exist on the system.'
|
||||
);
|
||||
throw new NotFoundHttpException('The requested resource does not exist on the system.');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function permission(): string
|
||||
{
|
||||
return Permission::ACTION_SCHEDULE_READ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue