GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 19-21 lines in 2 locations

app/Repositories/Daemon/CommandRepository.php 1 location

@@ 70-90 (lines=21) @@
67
     * @throws \Pterodactyl\Exceptions\DisplayException
68
     * @throws \GuzzleHttp\Exception\RequestException
69
     */
70
    public function send($command)
71
    {
72
        // We don't use the user's specific daemon secret here since we
73
        // are assuming that a call to this function has been validated.
74
        try {
75
            $response = $this->server->guzzleClient($this->user)->request('POST', '/server/command', [
76
                'http_errors' => false,
77
                'json' => [
78
                    'command' => $command,
79
                ],
80
            ]);
81
82
            if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
83
                throw new DisplayException('Command sending responded with a non-200 error code (HTTP/' . $response->getStatusCode() . ').');
84
            }
85
86
            return $response->getBody();
87
        } catch (ConnectException $ex) {
88
            throw $ex;
89
        }
90
    }
91
}
92

app/Repositories/Daemon/PowerRepository.php 1 location

@@ 70-88 (lines=19) @@
67
     * @throws \GuzzleHttp\Exception\RequestException
68
     * @throws \Pterodactyl\Exceptions\DisplayException
69
     */
70
    public function do($action)
71
    {
72
        try {
73
            $response = $this->server->guzzleClient($this->user)->request('PUT', '/server/power', [
74
                'http_errors' => false,
75
                'json' => [
76
                    'action' => $action,
77
                ],
78
            ]);
79
80
            if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
81
                throw new DisplayException('Power toggle endpoint responded with a non-200 error code (HTTP/' . $response->getStatusCode() . ').');
82
            }
83
84
            return $response->getBody();
85
        } catch (ConnectException $ex) {
86
            throw $ex;
87
        }
88
    }
89
90
    /**
91
     * Starts a server.