From 9410a54c988d927229de4a1784131d3a5450a7ca Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 13 Sep 2020 12:37:59 -0700 Subject: [PATCH] Removed unused interface functions --- .../Repository/UserRepositoryInterface.php | 19 --------- app/Repositories/Eloquent/UserRepository.php | 41 ------------------- 2 files changed, 60 deletions(-) diff --git a/app/Contracts/Repository/UserRepositoryInterface.php b/app/Contracts/Repository/UserRepositoryInterface.php index 5f80be708..9efd29fac 100644 --- a/app/Contracts/Repository/UserRepositoryInterface.php +++ b/app/Contracts/Repository/UserRepositoryInterface.php @@ -2,25 +2,6 @@ namespace Pterodactyl\Contracts\Repository; -use Illuminate\Support\Collection; -use Illuminate\Contracts\Pagination\LengthAwarePaginator; -use Pterodactyl\Contracts\Repository\Attributes\SearchableInterface; - interface UserRepositoryInterface extends RepositoryInterface { - /** - * Return all matching models for a user in a format that can be used for dropdowns. - * - * @param string|null $query - * @return \Illuminate\Support\Collection - */ - public function filterUsersByQuery(?string $query): Collection; - - /** - * Returns a user with the given id in a format that can be used for dropdowns. - * - * @param int $id - * @return \Pterodactyl\Models\Model - */ - public function filterById(int $id): \Pterodactyl\Models\Model; } diff --git a/app/Repositories/Eloquent/UserRepository.php b/app/Repositories/Eloquent/UserRepository.php index af6ebd710..72a88efb0 100644 --- a/app/Repositories/Eloquent/UserRepository.php +++ b/app/Repositories/Eloquent/UserRepository.php @@ -3,8 +3,6 @@ namespace Pterodactyl\Repositories\Eloquent; use Pterodactyl\Models\User; -use Illuminate\Support\Collection; -use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; class UserRepository extends EloquentRepository implements UserRepositoryInterface @@ -18,43 +16,4 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa { return User::class; } - - /** - * Return all matching models for a user in a format that can be used for dropdowns. - * - * @param string|null $query - * @return \Illuminate\Support\Collection - */ - public function filterUsersByQuery(?string $query): Collection - { - $this->setColumns([ - 'id', 'email', 'username', 'name_first', 'name_last', - ]); - - $instance = $this->getBuilder()->get($this->getColumns()); - - return $instance->transform(function ($item) { - $item->md5 = md5(strtolower($item->email)); - - return $item; - }); - } - - /** - * Returns a user with the given id in a format that can be used for dropdowns. - * - * @param int $id - * @return \Pterodactyl\Models\Model - */ - public function filterById(int $id): \Pterodactyl\Models\Model - { - $this->setColumns([ - 'id', 'email', 'username', 'name_first', 'name_last', - ]); - - $model = $this->getBuilder()->findOrFail($id, $this->getColumns())->getModel(); - $model->md5 = md5(strtolower($model->email)); - - return $model; - } }