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 = 16-16 lines in 2 locations

app/Repositories/OptionRepository.php 1 location

@@ 81-96 (lines=16) @@
78
     *
79
     * @throws \Pterodactyl\Exceptions\DisplayException
80
     */
81
    public function delete($id)
82
    {
83
        $option = ServiceOption::with('variables')->withCount('servers')->findOrFail($id);
84
85
        if ($option->servers_count > 0) {
86
            throw new DisplayException('You cannot delete a service option that has servers associated with it.');
87
        }
88
89
        DB::transaction(function () use ($option) {
90
            foreach ($option->variables as $variable) {
91
                (new VariableRepository)->delete($variable->id);
92
            }
93
94
            $option->delete();
95
        });
96
    }
97
98
    /**
99
     * Updates a service option in the database which can then be used

app/Repositories/ServiceRepository.php 1 location

@@ 119-134 (lines=16) @@
116
     *
117
     * @throws \Pterodactyl\Exceptions\DisplayException
118
     */
119
    public function delete($id)
120
    {
121
        $service = Service::withCount('servers')->with('options')->findOrFail($id);
122
123
        if ($service->servers_count > 0) {
124
            throw new DisplayException('You cannot delete a service that has servers associated with it.');
125
        }
126
127
        DB::transaction(function () use ($service) {
128
            foreach ($service->options as $option) {
129
                (new OptionRepository)->delete($option->id);
130
            }
131
132
            $service->delete();
133
        });
134
    }
135
}
136