Skip to content

Commit 9410a54

Browse files
committed
Removed unused interface functions
1 parent 8b4bd39 commit 9410a54

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

app/Contracts/Repository/UserRepositoryInterface.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@
22

33
namespace Pterodactyl\Contracts\Repository;
44

5-
use Illuminate\Support\Collection;
6-
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
7-
use Pterodactyl\Contracts\Repository\Attributes\SearchableInterface;
8-
95
interface UserRepositoryInterface extends RepositoryInterface
106
{
11-
/**
12-
* Return all matching models for a user in a format that can be used for dropdowns.
13-
*
14-
* @param string|null $query
15-
* @return \Illuminate\Support\Collection
16-
*/
17-
public function filterUsersByQuery(?string $query): Collection;
18-
19-
/**
20-
* Returns a user with the given id in a format that can be used for dropdowns.
21-
*
22-
* @param int $id
23-
* @return \Pterodactyl\Models\Model
24-
*/
25-
public function filterById(int $id): \Pterodactyl\Models\Model;
267
}

app/Repositories/Eloquent/UserRepository.php

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace Pterodactyl\Repositories\Eloquent;
44

55
use Pterodactyl\Models\User;
6-
use Illuminate\Support\Collection;
7-
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
86
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
97

108
class UserRepository extends EloquentRepository implements UserRepositoryInterface
@@ -18,43 +16,4 @@ public function model()
1816
{
1917
return User::class;
2018
}
21-
22-
/**
23-
* Return all matching models for a user in a format that can be used for dropdowns.
24-
*
25-
* @param string|null $query
26-
* @return \Illuminate\Support\Collection
27-
*/
28-
public function filterUsersByQuery(?string $query): Collection
29-
{
30-
$this->setColumns([
31-
'id', 'email', 'username', 'name_first', 'name_last',
32-
]);
33-
34-
$instance = $this->getBuilder()->get($this->getColumns());
35-
36-
return $instance->transform(function ($item) {
37-
$item->md5 = md5(strtolower($item->email));
38-
39-
return $item;
40-
});
41-
}
42-
43-
/**
44-
* Returns a user with the given id in a format that can be used for dropdowns.
45-
*
46-
* @param int $id
47-
* @return \Pterodactyl\Models\Model
48-
*/
49-
public function filterById(int $id): \Pterodactyl\Models\Model
50-
{
51-
$this->setColumns([
52-
'id', 'email', 'username', 'name_first', 'name_last',
53-
]);
54-
55-
$model = $this->getBuilder()->findOrFail($id, $this->getColumns())->getModel();
56-
$model->md5 = md5(strtolower($model->email));
57-
58-
return $model;
59-
}
6019
}

0 commit comments

Comments
 (0)