Skip to content

Commit 238ce43

Browse files
committed
interface_exists does not work how I expected, switch to is_subclass_of
1 parent 0487846 commit 238ce43

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

app/Http/Controllers/Admin/ServersController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ public function create()
242242
*
243243
* @throws \Pterodactyl\Exceptions\DisplayException
244244
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
245+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
245246
*/
246247
public function store(ServerFormRequest $request)
247248
{
@@ -278,6 +279,8 @@ public function viewIndex(Server $server)
278279
*
279280
* @param int $server
280281
* @return \Illuminate\View\View
282+
*
283+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
281284
*/
282285
public function viewDetails($server)
283286
{
@@ -294,6 +297,8 @@ public function viewDetails($server)
294297
*
295298
* @param int $server
296299
* @return \Illuminate\View\View
300+
*
301+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
297302
*/
298303
public function viewBuild($server)
299304
{
@@ -316,6 +321,8 @@ public function viewBuild($server)
316321
*
317322
* @param int $server
318323
* @return \Illuminate\View\View
324+
*
325+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
319326
*/
320327
public function viewStartup($server)
321328
{
@@ -346,6 +353,8 @@ public function viewStartup($server)
346353
*
347354
* @param int $server
348355
* @return \Illuminate\View\View
356+
*
357+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
349358
*/
350359
public function viewDatabase($server)
351360
{
@@ -388,6 +397,7 @@ public function viewDelete(Server $server)
388397
*
389398
* @throws \Pterodactyl\Exceptions\DisplayException
390399
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
400+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
391401
*/
392402
public function setDetails(Request $request, Server $server)
393403
{
@@ -409,6 +419,7 @@ public function setDetails(Request $request, Server $server)
409419
*
410420
* @throws \Pterodactyl\Exceptions\DisplayException
411421
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
422+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
412423
*/
413424
public function setContainer(Request $request, Server $server)
414425
{

app/Repositories/Eloquent/EloquentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function massUpdate(array $where, array $fields)
187187
public function all()
188188
{
189189
$instance = $this->getBuilder();
190-
if (interface_exists(SearchableInterface::class)) {
190+
if (is_subclass_of(get_called_class(), SearchableInterface::class)) {
191191
$instance = $instance->search($this->searchTerm);
192192
}
193193

0 commit comments

Comments
 (0)