From c424c0bc6d4d8ea81ce0be6802de02fa2f28dc96 Mon Sep 17 00:00:00 2001 From: alext Date: Sat, 23 Sep 2017 01:30:22 +0200 Subject: [PATCH] Reformatted PHP files --- src/application/controllers/Appointments.php | 27 +++-- src/application/controllers/Backend.php | 3 +- src/application/controllers/Backend_api.php | 108 ++++++++++++------ src/application/controllers/Google.php | 6 +- src/application/controllers/Installation.php | 3 +- src/application/controllers/User.php | 6 +- .../controllers/api/v1/API_V1_Controller.php | 3 +- src/application/controllers/api/v1/Admins.php | 12 +- .../controllers/api/v1/Appointments.php | 12 +- .../controllers/api/v1/Availabilities.php | 3 +- .../controllers/api/v1/Categories.php | 12 +- .../controllers/api/v1/Customers.php | 12 +- .../controllers/api/v1/Providers.php | 12 +- .../controllers/api/v1/Secretaries.php | 12 +- .../controllers/api/v1/Services.php | 12 +- .../controllers/api/v1/Settings.php | 9 +- .../controllers/api/v1/Unavailabilities.php | 12 +- src/application/libraries/Google_sync.php | 6 +- src/application/models/Services_model.php | 3 +- 19 files changed, 182 insertions(+), 91 deletions(-) diff --git a/src/application/controllers/Appointments.php b/src/application/controllers/Appointments.php index ee4cf3b5..dc416a58 100755 --- a/src/application/controllers/Appointments.php +++ b/src/application/controllers/Appointments.php @@ -134,7 +134,8 @@ class Appointments extends CI_Controller { 'provider_data' => $provider, 'customer_data' => $customer ]; - } catch (Exception $exc) + } + catch (Exception $exc) { $view['exceptions'][] = $exc; } @@ -201,7 +202,8 @@ class Appointments extends CI_Controller { $this->google_sync->refresh_token($google_token->refresh_token); $this->google_sync->delete_appointment($provider, $appointment['id_google_calendar']); } - } catch (Exception $exc) + } + catch (Exception $exc) { $exceptions[] = $exc; } @@ -233,11 +235,13 @@ class Appointments extends CI_Controller { new Text($this->input->post('cancel_reason'))); } - } catch (Exception $exc) + } + catch (Exception $exc) { $exceptions[] = $exc; } - } catch (Exception $exc) + } + catch (Exception $exc) { // Display the error message to the customer. $exceptions[] = $exc; @@ -374,7 +378,8 @@ class Appointments extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode($available_hours)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -478,7 +483,8 @@ class Appointments extends CI_Controller { $service, $customer, $company_settings); } } - } catch (Exception $exc) + } + catch (Exception $exc) { log_message('error', $exc->getMessage()); log_message('error', $exc->getTraceAsString()); @@ -527,7 +533,8 @@ class Appointments extends CI_Controller { $service, $customer, $company_settings, $provider_title, $provider_message, $provider_link, new Email($provider['email'])); } - } catch (Exception $exc) + } + catch (Exception $exc) { log_message('error', $exc->getMessage()); log_message('error', $exc->getTraceAsString()); @@ -538,7 +545,8 @@ class Appointments extends CI_Controller { ->set_output(json_encode([ 'appointment_id' => $appointment['id'] ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -615,7 +623,8 @@ class Appointments extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($unavailable_dates)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/Backend.php b/src/application/controllers/Backend.php index dff9156d..da08157c 100644 --- a/src/application/controllers/Backend.php +++ b/src/application/controllers/Backend.php @@ -323,7 +323,8 @@ class Backend extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/Backend_api.php b/src/application/controllers/Backend_api.php index 9254efd3..a48596a9 100644 --- a/src/application/controllers/Backend_api.php +++ b/src/application/controllers/Backend_api.php @@ -144,7 +144,8 @@ class Backend_api extends CI_Controller { } $this->output->set_output(json_encode($response)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output->set_output(json_encode([ 'exceptions' => [exceptionToJavaScript($exc)] @@ -228,7 +229,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($response)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -331,7 +333,8 @@ class Backend_api extends CI_Controller { $service, $customer, $company_settings); } } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = exceptionToJavaScript($exc); } @@ -378,7 +381,8 @@ class Backend_api extends CI_Controller { $provider_message, $provider_link, new Email($provider['email'])); } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = exceptionToJavaScript($exc); } @@ -394,7 +398,8 @@ class Backend_api extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode(['warnings' => $warnings])); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -463,7 +468,8 @@ class Backend_api extends CI_Controller { $this->google_sync->refresh_token($google_token->refresh_token); $this->google_sync->delete_appointment($provider, $appointment['id_google_calendar']); } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = exceptionToJavaScript($exc); } @@ -493,7 +499,8 @@ class Backend_api extends CI_Controller { $service, $customer, $company_settings, new Email($customer['email']), new Text($this->input->post('delete_reason'))); } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = exceptionToJavaScript($exc); } @@ -510,7 +517,8 @@ class Backend_api extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode(['warnings' => $warnings])); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -552,7 +560,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -615,7 +624,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($customers)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -678,7 +688,8 @@ class Backend_api extends CI_Controller { $google_event = $this->google_sync->update_unavailable($provider, $unavailable); } } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = $exc; } @@ -695,7 +706,8 @@ class Backend_api extends CI_Controller { ->set_output(json_encode(AJAX_SUCCESS)); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -739,7 +751,8 @@ class Backend_api extends CI_Controller { $this->google_sync->refresh_token($google_token->refresh_token); $this->google_sync->delete_unavailable($provider, $unavailable['id_google_calendar']); } - } catch (Exception $exc) + } + catch (Exception $exc) { $warnings[] = $exc; } @@ -756,7 +769,8 @@ class Backend_api extends CI_Controller { ->set_output(json_encode(AJAX_SUCCESS)); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -793,7 +807,8 @@ class Backend_api extends CI_Controller { 'status' => AJAX_SUCCESS, 'id' => $customer_id ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -822,7 +837,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -859,7 +875,8 @@ class Backend_api extends CI_Controller { 'status' => AJAX_SUCCESS, 'id' => $service_id ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -889,7 +906,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -925,7 +943,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($services)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -964,7 +983,8 @@ class Backend_api extends CI_Controller { 'status' => AJAX_SUCCESS, 'id' => $category_id ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -992,7 +1012,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1025,7 +1046,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($categories)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1063,7 +1085,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($admins)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1106,7 +1129,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($response)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1137,7 +1161,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1175,7 +1200,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($providers)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1224,7 +1250,8 @@ class Backend_api extends CI_Controller { 'status' => AJAX_SUCCESS, 'id' => $provider_id ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1255,7 +1282,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1293,7 +1321,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($secretaries)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1334,7 +1363,8 @@ class Backend_api extends CI_Controller { 'status' => AJAX_SUCCESS, 'id' => $secretary_id ])); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1366,7 +1396,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1414,7 +1445,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1442,7 +1474,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($is_valid)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1486,7 +1519,8 @@ class Backend_api extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1533,7 +1567,8 @@ class Backend_api extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode(AJAX_FAILURE)); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -1568,7 +1603,8 @@ class Backend_api extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($result ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/Google.php b/src/application/controllers/Google.php index 2339bac4..c20c3d07 100644 --- a/src/application/controllers/Google.php +++ b/src/application/controllers/Google.php @@ -198,7 +198,8 @@ class Google extends CI_Controller { $this->appointments_model->add($appointment); } - } catch (Exception $exc) + } + catch (Exception $exc) { // Appointment not found on gcal, delete from e!a. $this->appointments_model->delete($appointment['id']); @@ -235,7 +236,8 @@ class Google extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/Installation.php b/src/application/controllers/Installation.php index 4be9f0e1..b3e1c4cc 100644 --- a/src/application/controllers/Installation.php +++ b/src/application/controllers/Installation.php @@ -126,7 +126,8 @@ class Installation extends CI_Controller { ->set_content_type('application/json') ->set_output(json_encode(AJAX_SUCCESS)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/User.php b/src/application/controllers/User.php index 8fabcfa5..259ee5df 100644 --- a/src/application/controllers/User.php +++ b/src/application/controllers/User.php @@ -142,7 +142,8 @@ class User extends CI_Controller { ->set_output(json_encode(AJAX_FAILURE)); } - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') @@ -192,7 +193,8 @@ class User extends CI_Controller { $this->output ->set_content_type('application/json') ->set_output(json_encode($new_password != FALSE ? AJAX_SUCCESS : AJAX_FAILURE)); - } catch (Exception $exc) + } + catch (Exception $exc) { $this->output ->set_content_type('application/json') diff --git a/src/application/controllers/api/v1/API_V1_Controller.php b/src/application/controllers/api/v1/API_V1_Controller.php index e6765620..3170ba6b 100644 --- a/src/application/controllers/api/v1/API_V1_Controller.php +++ b/src/application/controllers/api/v1/API_V1_Controller.php @@ -49,7 +49,8 @@ class API_V1_Controller extends CI_Controller { $password = new NonEmptyText($_SERVER['PHP_AUTH_PW']); $authorization = new \EA\Engine\Api\V1\Authorization($this); $authorization->basic($username, $password); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } diff --git a/src/application/controllers/api/v1/Admins.php b/src/application/controllers/api/v1/Admins.php index 9a2c77ff..04a152be 100644 --- a/src/application/controllers/api/v1/Admins.php +++ b/src/application/controllers/api/v1/Admins.php @@ -68,7 +68,8 @@ class Admins extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Admins extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Admins extends API_V1_Controller { $batch = $this->admins_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Admins extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Appointments.php b/src/application/controllers/api/v1/Appointments.php index c473d110..becc3477 100644 --- a/src/application/controllers/api/v1/Appointments.php +++ b/src/application/controllers/api/v1/Appointments.php @@ -68,7 +68,8 @@ class Appointments extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -98,7 +99,8 @@ class Appointments extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -132,7 +134,8 @@ class Appointments extends API_V1_Controller { $batch = $this->appointments_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -155,7 +158,8 @@ class Appointments extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } diff --git a/src/application/controllers/api/v1/Availabilities.php b/src/application/controllers/api/v1/Availabilities.php index 2a61e6be..820a59ec 100644 --- a/src/application/controllers/api/v1/Availabilities.php +++ b/src/application/controllers/api/v1/Availabilities.php @@ -74,7 +74,8 @@ class Availabilities extends API_V1_Controller { ->set_content_type('application/json') ->set_output(json_encode($availableHours)); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } diff --git a/src/application/controllers/api/v1/Categories.php b/src/application/controllers/api/v1/Categories.php index 771eb9e6..eb4a6f90 100644 --- a/src/application/controllers/api/v1/Categories.php +++ b/src/application/controllers/api/v1/Categories.php @@ -68,7 +68,8 @@ class Categories extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Categories extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Categories extends API_V1_Controller { $batch = $this->services_model->get_all_categories('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Categories extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Customers.php b/src/application/controllers/api/v1/Customers.php index d8849143..3c420fe9 100644 --- a/src/application/controllers/api/v1/Customers.php +++ b/src/application/controllers/api/v1/Customers.php @@ -68,7 +68,8 @@ class Customers extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Customers extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Customers extends API_V1_Controller { $batch = $this->customers_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Customers extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Providers.php b/src/application/controllers/api/v1/Providers.php index f122aa7f..4b732670 100644 --- a/src/application/controllers/api/v1/Providers.php +++ b/src/application/controllers/api/v1/Providers.php @@ -68,7 +68,8 @@ class Providers extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Providers extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Providers extends API_V1_Controller { $batch = $this->providers_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Providers extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Secretaries.php b/src/application/controllers/api/v1/Secretaries.php index 5eb1a46b..287ab49c 100644 --- a/src/application/controllers/api/v1/Secretaries.php +++ b/src/application/controllers/api/v1/Secretaries.php @@ -68,7 +68,8 @@ class Secretaries extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Secretaries extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Secretaries extends API_V1_Controller { $batch = $this->secretaries_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Secretaries extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Services.php b/src/application/controllers/api/v1/Services.php index d9fbcfe3..77d318ef 100644 --- a/src/application/controllers/api/v1/Services.php +++ b/src/application/controllers/api/v1/Services.php @@ -68,7 +68,8 @@ class Services extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -98,7 +99,8 @@ class Services extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -132,7 +134,8 @@ class Services extends API_V1_Controller { $batch = $this->services_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } @@ -155,7 +158,8 @@ class Services extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { $this->_handleException($exception); } diff --git a/src/application/controllers/api/v1/Settings.php b/src/application/controllers/api/v1/Settings.php index ba1421e1..00bbaa68 100644 --- a/src/application/controllers/api/v1/Settings.php +++ b/src/application/controllers/api/v1/Settings.php @@ -86,7 +86,8 @@ class Settings extends API_V1_Controller { ->singleEntry($name) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -113,7 +114,8 @@ class Settings extends API_V1_Controller { ] ]); $response->encode($this->parser)->singleEntry($name)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -136,7 +138,8 @@ class Settings extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } diff --git a/src/application/controllers/api/v1/Unavailabilities.php b/src/application/controllers/api/v1/Unavailabilities.php index 081974d4..1fdce6cc 100644 --- a/src/application/controllers/api/v1/Unavailabilities.php +++ b/src/application/controllers/api/v1/Unavailabilities.php @@ -68,7 +68,8 @@ class Unavailabilities extends API_V1_Controller { ->singleEntry($id) ->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -98,7 +99,8 @@ class Unavailabilities extends API_V1_Controller { $response = new Response($batch); $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(TRUE)->output($status); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -132,7 +134,8 @@ class Unavailabilities extends API_V1_Controller { $batch = $this->appointments_model->get_batch('id = ' . $id); $response = new Response($batch); $response->encode($this->parser)->singleEntry($id)->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } @@ -155,7 +158,8 @@ class Unavailabilities extends API_V1_Controller { ]); $response->output(); - } catch (\Exception $exception) + } + catch (\Exception $exception) { exit($this->_handleException($exception)); } diff --git a/src/application/libraries/Google_sync.php b/src/application/libraries/Google_sync.php index b7ebd964..fd889cc6 100644 --- a/src/application/libraries/Google_sync.php +++ b/src/application/libraries/Google_sync.php @@ -244,7 +244,8 @@ class Google_Sync { try { $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); - } catch (Exception $ex) + } + catch (Exception $ex) { // Event was not found on Google Calendar. } @@ -322,7 +323,8 @@ class Google_Sync { try { $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); - } catch (Exception $ex) + } + catch (Exception $ex) { // Event was not found on Google Calendar. } diff --git a/src/application/models/Services_model.php b/src/application/models/Services_model.php index f5946acb..6ae51393 100644 --- a/src/application/models/Services_model.php +++ b/src/application/models/Services_model.php @@ -463,7 +463,8 @@ class Services_Model extends CI_Model { } return TRUE; - } catch (Exception $exc) + } + catch (Exception $exc) { return FALSE; }