From aee7bb80c0fdd1683ac16cfd1da5603ef8cb053e Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 5 Jan 2024 19:12:25 +0100 Subject: [PATCH] Add return types --- application/controllers/api/v1/Admins_api_v1.php | 10 +++++----- .../controllers/api/v1/Appointments_api_v1.php | 12 ++++++------ .../controllers/api/v1/Availabilities_api_v1.php | 2 +- application/controllers/api/v1/Customers_api_v1.php | 10 +++++----- application/controllers/api/v1/Providers_api_v1.php | 10 +++++----- .../controllers/api/v1/Secretaries_api_v1.php | 10 +++++----- .../controllers/api/v1/Service_categories_api_v1.php | 10 +++++----- application/controllers/api/v1/Services_api_v1.php | 10 +++++----- application/controllers/api/v1/Settings_api_v1.php | 4 ++-- .../controllers/api/v1/Unavailabilities_api_v1.php | 10 +++++----- application/controllers/api/v1/Webhooks_api_v1.php | 10 +++++----- 11 files changed, 49 insertions(+), 49 deletions(-) diff --git a/application/controllers/api/v1/Admins_api_v1.php b/application/controllers/api/v1/Admins_api_v1.php index d751c120..5f15216b 100644 --- a/application/controllers/api/v1/Admins_api_v1.php +++ b/application/controllers/api/v1/Admins_api_v1.php @@ -37,7 +37,7 @@ class Admins_api_v1 extends EA_Controller /** * Get an admin collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -79,7 +79,7 @@ class Admins_api_v1 extends EA_Controller * * @param int|null $id Admin ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -113,7 +113,7 @@ class Admins_api_v1 extends EA_Controller /** * Store a new admin. */ - public function store() + public function store(): void { try { $admin = request(); @@ -145,7 +145,7 @@ class Admins_api_v1 extends EA_Controller * * @param int $id Admin ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->admins_model->get(['id' => $id]); @@ -179,7 +179,7 @@ class Admins_api_v1 extends EA_Controller * * @param int $id Admin ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->admins_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Appointments_api_v1.php b/application/controllers/api/v1/Appointments_api_v1.php index 44cf4883..54e3c2d2 100644 --- a/application/controllers/api/v1/Appointments_api_v1.php +++ b/application/controllers/api/v1/Appointments_api_v1.php @@ -43,7 +43,7 @@ class Appointments_api_v1 extends EA_Controller /** * Get an appointment collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -143,7 +143,7 @@ class Appointments_api_v1 extends EA_Controller * * @deprecated Since 1.5 */ - private function aggregates(array &$appointment) + private function aggregates(array &$appointment): void { $aggregates = request('aggregates') !== null; @@ -171,7 +171,7 @@ class Appointments_api_v1 extends EA_Controller * * @param int|null $id Appointment ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -205,7 +205,7 @@ class Appointments_api_v1 extends EA_Controller /** * Store a new appointment. */ - public function store() + public function store(): void { try { $appointment = request(); @@ -295,7 +295,7 @@ class Appointments_api_v1 extends EA_Controller * * @param int $id Appointment ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->appointments_model->get(['id' => $id]); @@ -331,7 +331,7 @@ class Appointments_api_v1 extends EA_Controller * * @param int $id Appointment ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->appointments_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Availabilities_api_v1.php b/application/controllers/api/v1/Availabilities_api_v1.php index e0a87ec8..a696b52d 100644 --- a/application/controllers/api/v1/Availabilities_api_v1.php +++ b/application/controllers/api/v1/Availabilities_api_v1.php @@ -54,7 +54,7 @@ class Availabilities_api_v1 extends EA_Controller * * If no date parameter is provided then the current date will be used. */ - public function get() + public function get(): void { try { $provider_id = request('providerId'); diff --git a/application/controllers/api/v1/Customers_api_v1.php b/application/controllers/api/v1/Customers_api_v1.php index 693cc7b5..8f0b5fdd 100644 --- a/application/controllers/api/v1/Customers_api_v1.php +++ b/application/controllers/api/v1/Customers_api_v1.php @@ -35,7 +35,7 @@ class Customers_api_v1 extends EA_Controller /** * Get a customer collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Customers_api_v1 extends EA_Controller * * @param int|null $id Customer ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -105,7 +105,7 @@ class Customers_api_v1 extends EA_Controller /** * Store a new customer. */ - public function store() + public function store(): void { try { $customer = request(); @@ -133,7 +133,7 @@ class Customers_api_v1 extends EA_Controller * * @param int $id Customer ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->customers_model->get(['id' => $id]); @@ -167,7 +167,7 @@ class Customers_api_v1 extends EA_Controller * * @param int $id Customer ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->customers_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Providers_api_v1.php b/application/controllers/api/v1/Providers_api_v1.php index 916942b9..5613fa40 100644 --- a/application/controllers/api/v1/Providers_api_v1.php +++ b/application/controllers/api/v1/Providers_api_v1.php @@ -35,7 +35,7 @@ class Providers_api_v1 extends EA_Controller /** * Get a provider collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Providers_api_v1 extends EA_Controller * * @param int|null $id Provider ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -111,7 +111,7 @@ class Providers_api_v1 extends EA_Controller /** * Store a new provider. */ - public function store() + public function store(): void { try { $provider = request(); @@ -151,7 +151,7 @@ class Providers_api_v1 extends EA_Controller * * @param int $id Provider ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->providers_model->get(['id' => $id]); @@ -185,7 +185,7 @@ class Providers_api_v1 extends EA_Controller * * @param int $id Provider ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->providers_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Secretaries_api_v1.php b/application/controllers/api/v1/Secretaries_api_v1.php index 9d151565..7ff4c8c4 100644 --- a/application/controllers/api/v1/Secretaries_api_v1.php +++ b/application/controllers/api/v1/Secretaries_api_v1.php @@ -35,7 +35,7 @@ class Secretaries_api_v1 extends EA_Controller /** * Get a secretary collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Secretaries_api_v1 extends EA_Controller * * @param int|null $id Secretary ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -105,7 +105,7 @@ class Secretaries_api_v1 extends EA_Controller /** * Store a new secretary. */ - public function store() + public function store(): void { try { $secretary = request(); @@ -141,7 +141,7 @@ class Secretaries_api_v1 extends EA_Controller * * @param int $id Secretary ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->secretaries_model->get(['id' => $id]); @@ -175,7 +175,7 @@ class Secretaries_api_v1 extends EA_Controller * * @param int $id Secretary ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->secretaries_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Service_categories_api_v1.php b/application/controllers/api/v1/Service_categories_api_v1.php index c8c84481..c0b288f9 100644 --- a/application/controllers/api/v1/Service_categories_api_v1.php +++ b/application/controllers/api/v1/Service_categories_api_v1.php @@ -35,7 +35,7 @@ class Service_categories_api_v1 extends EA_Controller /** * Get a service-category collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Service_categories_api_v1 extends EA_Controller * * @param int|null $id Service-category ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -111,7 +111,7 @@ class Service_categories_api_v1 extends EA_Controller /** * Store a new service-category. */ - public function store() + public function store(): void { try { $service_category = request(); @@ -139,7 +139,7 @@ class Service_categories_api_v1 extends EA_Controller * * @param int $id Service-category ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->service_categories_model->get(['id' => $id]); @@ -173,7 +173,7 @@ class Service_categories_api_v1 extends EA_Controller * * @param int $id Service-category ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->service_categories_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Services_api_v1.php b/application/controllers/api/v1/Services_api_v1.php index fa6f250d..47eaa7cd 100644 --- a/application/controllers/api/v1/Services_api_v1.php +++ b/application/controllers/api/v1/Services_api_v1.php @@ -35,7 +35,7 @@ class Services_api_v1 extends EA_Controller /** * Get an service collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Services_api_v1 extends EA_Controller * * @param int|null $id Service ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -111,7 +111,7 @@ class Services_api_v1 extends EA_Controller /** * Store a new service. */ - public function store() + public function store(): void { try { $service = request(); @@ -139,7 +139,7 @@ class Services_api_v1 extends EA_Controller * * @param int $id Service ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->services_model->get(['id' => $id]); @@ -173,7 +173,7 @@ class Services_api_v1 extends EA_Controller * * @param int $id Service ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->services_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Settings_api_v1.php b/application/controllers/api/v1/Settings_api_v1.php index 177757f6..e32f237c 100644 --- a/application/controllers/api/v1/Settings_api_v1.php +++ b/application/controllers/api/v1/Settings_api_v1.php @@ -71,7 +71,7 @@ class Settings_api_v1 extends EA_Controller * * @param string $name Setting name. */ - public function show(string $name) + public function show(string $name): void { try { $value = setting($name); @@ -90,7 +90,7 @@ class Settings_api_v1 extends EA_Controller * * @param string $name Setting name. */ - public function update(string $name) + public function update(string $name): void { try { $value = request('value'); diff --git a/application/controllers/api/v1/Unavailabilities_api_v1.php b/application/controllers/api/v1/Unavailabilities_api_v1.php index dbf304bd..0c6d7bc8 100644 --- a/application/controllers/api/v1/Unavailabilities_api_v1.php +++ b/application/controllers/api/v1/Unavailabilities_api_v1.php @@ -35,7 +35,7 @@ class Unavailabilities_api_v1 extends EA_Controller /** * Get an unavailability collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Unavailabilities_api_v1 extends EA_Controller * * @param int|null $id Unavailability ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -111,7 +111,7 @@ class Unavailabilities_api_v1 extends EA_Controller /** * Store a new unavailability. */ - public function store() + public function store(): void { try { $unavailability = request(); @@ -139,7 +139,7 @@ class Unavailabilities_api_v1 extends EA_Controller * * @param int $id Unavailability ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->unavailabilities_model->get(['id' => $id]); @@ -173,7 +173,7 @@ class Unavailabilities_api_v1 extends EA_Controller * * @param int $id Unavailability ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->unavailabilities_model->get(['id' => $id]); diff --git a/application/controllers/api/v1/Webhooks_api_v1.php b/application/controllers/api/v1/Webhooks_api_v1.php index b7baa954..e1e019f6 100644 --- a/application/controllers/api/v1/Webhooks_api_v1.php +++ b/application/controllers/api/v1/Webhooks_api_v1.php @@ -35,7 +35,7 @@ class Webhooks_api_v1 extends EA_Controller /** * Get a webhook collection. */ - public function index() + public function index(): void { try { $keyword = $this->api->request_keyword(); @@ -77,7 +77,7 @@ class Webhooks_api_v1 extends EA_Controller * * @param int|null $id Webhook ID. */ - public function show(int $id = null) + public function show(int $id = null): void { try { $fields = $this->api->request_fields(); @@ -111,7 +111,7 @@ class Webhooks_api_v1 extends EA_Controller /** * Store a new webhook. */ - public function store() + public function store(): void { try { $webhook = request(); @@ -139,7 +139,7 @@ class Webhooks_api_v1 extends EA_Controller * * @param int $id Webhook ID. */ - public function update(int $id) + public function update(int $id): void { try { $occurrences = $this->webhooks_model->get(['id' => $id]); @@ -173,7 +173,7 @@ class Webhooks_api_v1 extends EA_Controller * * @param int $id Webhook ID. */ - public function destroy(int $id) + public function destroy(int $id): void { try { $occurrences = $this->webhooks_model->get(['id' => $id]);