diff --git a/lib/API/JSON/API.php b/lib/API/JSON/API.php index d9d442d90e..48012a60a4 100644 --- a/lib/API/JSON/API.php +++ b/lib/API/JSON/API.php @@ -172,7 +172,7 @@ class API { } $response = $endpoint->{$this->_request_method}($this->_request_data); return $response; - } catch(\Exception $e) { + } catch (\Exception $e) { $error_message = $e->getMessage(); $error_response = $this->createErrorResponse(Error::BAD_REQUEST, $error_message, Response::STATUS_BAD_REQUEST); return $error_response; diff --git a/lib/API/JSON/v1/Forms.php b/lib/API/JSON/v1/Forms.php index bf63f74f3c..ef3272c2d0 100644 --- a/lib/API/JSON/v1/Forms.php +++ b/lib/API/JSON/v1/Forms.php @@ -293,7 +293,7 @@ class Forms extends APIEndpoint { try { $meta = $this->bulk_action->apply('\MailPoet\Models\Form', $data); return $this->successResponse(null, $meta); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/ImportExport.php b/lib/API/JSON/v1/ImportExport.php index 62ff5dead0..30d0925b60 100644 --- a/lib/API/JSON/v1/ImportExport.php +++ b/lib/API/JSON/v1/ImportExport.php @@ -19,7 +19,7 @@ class ImportExport extends APIEndpoint { $mailChimp = new MailChimp($data['api_key']); $lists = $mailChimp->getLists(); return $this->successResponse($lists); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -31,7 +31,7 @@ class ImportExport extends APIEndpoint { $mailChimp = new MailChimp($data['api_key']); $subscribers = $mailChimp->getSubscribers($data['lists']); return $this->successResponse($subscribers); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -58,7 +58,7 @@ class ImportExport extends APIEndpoint { ); $process = $import->process(); return $this->successResponse($process); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -72,10 +72,10 @@ class ImportExport extends APIEndpoint { ); $process = $export->process(); return $this->successResponse($process); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); } } -} \ No newline at end of file +} diff --git a/lib/API/JSON/v1/MP2Migrator.php b/lib/API/JSON/v1/MP2Migrator.php index 96967e6f33..5a82277302 100644 --- a/lib/API/JSON/v1/MP2Migrator.php +++ b/lib/API/JSON/v1/MP2Migrator.php @@ -27,7 +27,7 @@ class MP2Migrator extends APIEndpoint { try { $process = $this->MP2Migrator->import($data); return $this->successResponse($process); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -44,7 +44,7 @@ class MP2Migrator extends APIEndpoint { try { $process = $this->MP2Migrator->stopImport(); return $this->successResponse($process); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -61,7 +61,7 @@ class MP2Migrator extends APIEndpoint { try { $process = $this->MP2Migrator->skipImport(); return $this->successResponse($process); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Mailer.php b/lib/API/JSON/v1/Mailer.php index ba0ec4dff7..7f230a58ac 100644 --- a/lib/API/JSON/v1/Mailer.php +++ b/lib/API/JSON/v1/Mailer.php @@ -22,7 +22,7 @@ class Mailer extends APIEndpoint { (isset($data['reply_to'])) ? $data['reply_to'] : false ); $result = $mailer->send($data['newsletter'], $data['subscriber']); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Newsletters.php b/lib/API/JSON/v1/Newsletters.php index 5925f72798..4e7cf1fc12 100644 --- a/lib/API/JSON/v1/Newsletters.php +++ b/lib/API/JSON/v1/Newsletters.php @@ -394,7 +394,7 @@ class Newsletters extends APIEndpoint { Newsletter::findOne($id)->asArray() ); } - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -464,7 +464,7 @@ class Newsletters extends APIEndpoint { try { $meta = $this->bulk_action->apply('\MailPoet\Models\Newsletter', $data); return $this->successResponse(null, $meta); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Segments.php b/lib/API/JSON/v1/Segments.php index 5ce04418bc..c56bdfb52d 100644 --- a/lib/API/JSON/v1/Segments.php +++ b/lib/API/JSON/v1/Segments.php @@ -150,7 +150,7 @@ class Segments extends APIEndpoint { function synchronize() { try { WP::synchronizeUsers(); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -163,7 +163,7 @@ class Segments extends APIEndpoint { try { $meta = $this->bulk_action->apply('\MailPoet\Models\Segment', $data); return $this->successResponse(null, $meta); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/SendingQueue.php b/lib/API/JSON/v1/SendingQueue.php index e7833483c8..e0d04d953c 100644 --- a/lib/API/JSON/v1/SendingQueue.php +++ b/lib/API/JSON/v1/SendingQueue.php @@ -36,7 +36,7 @@ class SendingQueue extends APIEndpoint { // check that the sending method has been configured properly try { new \MailPoet\Mailer\Mailer(false); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Services.php b/lib/API/JSON/v1/Services.php index 9379464c15..bd4b83fadc 100644 --- a/lib/API/JSON/v1/Services.php +++ b/lib/API/JSON/v1/Services.php @@ -37,7 +37,7 @@ class Services extends APIEndpoint { try { $result = $this->bridge->checkMSSKey($key); $this->bridge->storeMSSKeyAndState($key, $result); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); @@ -99,7 +99,7 @@ class Services extends APIEndpoint { try { $result = $this->bridge->checkPremiumKey($key); $this->bridge->storePremiumKeyAndState($key, $result); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Setup.php b/lib/API/JSON/v1/Setup.php index 4e70de9189..c139ed3c53 100644 --- a/lib/API/JSON/v1/Setup.php +++ b/lib/API/JSON/v1/Setup.php @@ -27,7 +27,7 @@ class Setup extends APIEndpoint { $activator->activate(); $this->wp->doAction('mailpoet_setup_reset'); return $this->successResponse(); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/API/JSON/v1/Subscribers.php b/lib/API/JSON/v1/Subscribers.php index b8765acd94..5bc6296897 100644 --- a/lib/API/JSON/v1/Subscribers.php +++ b/lib/API/JSON/v1/Subscribers.php @@ -300,7 +300,7 @@ class Subscribers extends APIEndpoint { $bulk_action = new BulkAction($data); return $this->successResponse(null, $bulk_action->apply()); } - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); diff --git a/lib/Config/Initializer.php b/lib/Config/Initializer.php index c3368b8cca..bfeb0fe156 100644 --- a/lib/Config/Initializer.php +++ b/lib/Config/Initializer.php @@ -47,7 +47,7 @@ class Initializer { try { $this->setupDB(); - } catch(\Exception $e) { + } catch (\Exception $e) { return WPNotice::displayError(Helpers::replaceLinkTags( __('Unable to connect to the database (the database is unable to open a file or folder), the connection is likely not configured correctly. Please read our [link] Knowledge Base article [/link] for steps how to resolve it.', 'mailpoet'), '//beta.docs.mailpoet.com/article/200-solving-database-connection-issues', @@ -120,7 +120,7 @@ class Initializer { try { $this->setupRenderer(); $this->setupWidget(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->handleFailedInitialization($e); } } @@ -158,7 +158,7 @@ class Initializer { $this->setupDeactivationSurvey(); do_action('mailpoet_initialized', MAILPOET_VERSION); - } catch(\Exception $e) { + } catch (\Exception $e) { return $this->handleFailedInitialization($e); } @@ -168,7 +168,7 @@ class Initializer { function maybeDbUpdate() { try { $current_db_version = $this->container->get(SettingsController::class)->get('db_version'); - } catch(\Exception $e) { + } catch (\Exception $e) { $current_db_version = null; } @@ -252,7 +252,7 @@ class Initializer { $this->setupJSONAPI(); $this->setupRouter(); $this->setupUserLocale(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->handleFailedInitialization($e); } } diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index 3a1ca81667..6e6644d962 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -852,7 +852,7 @@ class Menu { function displayPage($template, $data) { try { echo $this->renderer->render($template, $data); - } catch(\Exception $e) { + } catch (\Exception $e) { $notice = new WPNotice(WPNotice::TYPE_ERROR, $e->getMessage()); $notice->displayWPNotice(); } diff --git a/lib/Config/Renderer.php b/lib/Config/Renderer.php index a1dbbd314c..355184518a 100644 --- a/lib/Config/Renderer.php +++ b/lib/Config/Renderer.php @@ -107,7 +107,7 @@ class Renderer { function render($template, $context = array()) { try { return $this->renderer->render($template, $context); - } catch(\RuntimeException $e) { + } catch (\RuntimeException $e) { throw new \Exception(sprintf( __('Failed to render template "%s". Please ensure the template cache folder "%s" exists and has write permissions. Terminated with error: "%s"'), $template, diff --git a/lib/Config/RequirementsChecker.php b/lib/Config/RequirementsChecker.php index deaa8bad34..5ca3291efe 100644 --- a/lib/Config/RequirementsChecker.php +++ b/lib/Config/RequirementsChecker.php @@ -156,7 +156,7 @@ class RequirementsChecker { try { $reflector = new \ReflectionClass($namespaced_class); return $reflector->getFileName(); - } catch(\ReflectionException $ex) { + } catch (\ReflectionException $ex) { return false; } } diff --git a/lib/Cron/CronTrigger.php b/lib/Cron/CronTrigger.php index c1d7c847bf..05090d1e75 100644 --- a/lib/Cron/CronTrigger.php +++ b/lib/Cron/CronTrigger.php @@ -27,7 +27,7 @@ class CronTrigger { return (class_exists($trigger_class)) ? $trigger_class::run() : false; - } catch(\Exception $e) { + } catch (\Exception $e) { // cron exceptions should not prevent the rest of the site from loading } } diff --git a/lib/Cron/Daemon.php b/lib/Cron/Daemon.php index 86149cca68..8778d86771 100644 --- a/lib/Cron/Daemon.php +++ b/lib/Cron/Daemon.php @@ -28,7 +28,7 @@ class Daemon { $this->executePremiumKeyCheckWorker(); $this->executeBounceWorker(); // TODO: execute WooCommerceSync worker - } catch(\Exception $e) { + } catch (\Exception $e) { CronHelper::saveDaemonLastError($e->getMessage()); } // Log successful execution diff --git a/lib/Cron/Workers/StatsNotifications/Worker.php b/lib/Cron/Workers/StatsNotifications/Worker.php index 7d474020f8..51725537b6 100644 --- a/lib/Cron/Workers/StatsNotifications/Worker.php +++ b/lib/Cron/Workers/StatsNotifications/Worker.php @@ -46,7 +46,7 @@ class Worker { foreach (self::getDueTasks() as $task) { try { $this->mailer->send($this->constructNewsletter($task), $settings['address']); - } catch(\Exception $e) { + } catch (\Exception $e) { if(WP_DEBUG) { throw $e; } diff --git a/lib/Form/Block/Date.php b/lib/Form/Block/Date.php index b76542edf7..a264262e8e 100644 --- a/lib/Form/Block/Date.php +++ b/lib/Form/Block/Date.php @@ -281,7 +281,7 @@ class Date extends Base { if($datetime !== false && !empty($datetime)) { try { $datetime = Carbon::parse($datetime)->toDateTimeString(); - } catch(\Exception $e) { + } catch (\Exception $e) { $datetime = false; } } diff --git a/lib/Form/Widget.php b/lib/Form/Widget.php index bcc93eccac..b06b786ee5 100644 --- a/lib/Form/Widget.php +++ b/lib/Form/Widget.php @@ -89,7 +89,7 @@ class Widget extends \WP_Widget { try { echo $this->renderer->render('form/iframe.html', $data); - } catch(\Exception $e) { + } catch (\Exception $e) { echo $e->getMessage(); } @@ -328,7 +328,7 @@ EOL; $output = $renderer->render('form/widget.html', $data); $output = do_shortcode($output); $output = $this->wp->applyFilters('mailpoet_form_widget_post_process', $output); - } catch(\Exception $e) { + } catch (\Exception $e) { $output = $e->getMessage(); } } diff --git a/lib/Mailer/Methods/AmazonSES.php b/lib/Mailer/Methods/AmazonSES.php index ef8f25e8ef..ea15357dd3 100644 --- a/lib/Mailer/Methods/AmazonSES.php +++ b/lib/Mailer/Methods/AmazonSES.php @@ -72,7 +72,7 @@ class AmazonSES { $this->url, $this->request($newsletter, $subscriber, $extra_params) ); - } catch(\Exception $e) { + } catch (\Exception $e) { $error = $this->error_mapper->getErrorFromException($e, $subscriber); return Mailer::formatMailerErrorResult($error); } diff --git a/lib/Mailer/Methods/PHPMail.php b/lib/Mailer/Methods/PHPMail.php index 1ac8671071..558f49e646 100644 --- a/lib/Mailer/Methods/PHPMail.php +++ b/lib/Mailer/Methods/PHPMail.php @@ -32,7 +32,7 @@ class PHPMail { try { $mailer = $this->configureMailerWithMessage($newsletter, $subscriber, $extra_params); $result = $mailer->send(); - } catch(\Exception $e) { + } catch (\Exception $e) { return Mailer::formatMailerErrorResult($this->error_mapper->getErrorFromException($e, $subscriber)); } if($result === true) { diff --git a/lib/Mailer/Methods/SMTP.php b/lib/Mailer/Methods/SMTP.php index 577365a07b..cb3daeac0a 100644 --- a/lib/Mailer/Methods/SMTP.php +++ b/lib/Mailer/Methods/SMTP.php @@ -51,7 +51,7 @@ class SMTP { try { $message = $this->createMessage($newsletter, $subscriber, $extra_params); $result = $this->mailer->send($message); - } catch(\Exception $e) { + } catch (\Exception $e) { return Mailer::formatMailerErrorResult( $this->error_mapper->getErrorFromException($e, $subscriber) ); diff --git a/lib/Models/Model.php b/lib/Models/Model.php index ea798fe4cb..faf071f65b 100644 --- a/lib/Models/Model.php +++ b/lib/Models/Model.php @@ -197,9 +197,9 @@ class Model extends \Sudzy\ValidModel { $this->_new_record = $this->isNew(); try { parent::save(); - } catch(\Sudzy\ValidationException $e) { + } catch (\Sudzy\ValidationException $e) { $this->setError($e->getValidationErrors()); - } catch(\PDOException $e) { + } catch (\PDOException $e) { switch ($e->getCode()) { case 23000: preg_match("/for key \'(.*?)\'/i", $e->getMessage(), $matches); @@ -330,7 +330,7 @@ class Model extends \Sudzy\ValidModel { public static function __callStatic($method, $parameters) { try { return parent::__callStatic($method, $parameters); - } catch(\PDOException $e) { + } catch (\PDOException $e) { throw new \Exception($e->getMessage()); } } diff --git a/lib/Models/ScheduledTask.php b/lib/Models/ScheduledTask.php index a37c8c5440..f5d7ab5f55 100644 --- a/lib/Models/ScheduledTask.php +++ b/lib/Models/ScheduledTask.php @@ -103,7 +103,7 @@ class ScheduledTask extends Model { ScheduledTaskSubscriber::where('task_id', $this->id)->deleteMany(); parent::delete(); \ORM::get_db()->commit(); - } catch(\Exception $error) { + } catch (\Exception $error) { \ORM::get_db()->rollBack(); throw $error; } diff --git a/lib/Newsletter/Scheduler/Scheduler.php b/lib/Newsletter/Scheduler/Scheduler.php index 35ea144eca..f1cb8074a7 100644 --- a/lib/Newsletter/Scheduler/Scheduler.php +++ b/lib/Newsletter/Scheduler/Scheduler.php @@ -233,7 +233,7 @@ class Scheduler { $schedule = \Cron\CronExpression::factory($schedule); $next_run_date = $schedule->getNextRunDate(Carbon::createFromTimestamp($from_timestamp)) ->format('Y-m-d H:i:s'); - } catch(\Exception $e) { + } catch (\Exception $e) { $next_run_date = false; } return $next_run_date; @@ -246,7 +246,7 @@ class Scheduler { $schedule = \Cron\CronExpression::factory($schedule); $previous_run_date = $schedule->getPreviousRunDate(Carbon::createFromTimestamp($from_timestamp)) ->format('Y-m-d H:i:s'); - } catch(\Exception $e) { + } catch (\Exception $e) { $previous_run_date = false; } return $previous_run_date; diff --git a/lib/Services/Bridge.php b/lib/Services/Bridge.php index 3cbc92c496..1c733dbb00 100644 --- a/lib/Services/Bridge.php +++ b/lib/Services/Bridge.php @@ -43,7 +43,7 @@ class Bridge { $mailer_config = Mailer::getMailerConfig(); return !empty($mailer_config['method']) && $mailer_config['method'] === Mailer::METHOD_MAILPOET; - } catch(\Exception $e) { + } catch (\Exception $e) { return false; } } diff --git a/lib/Subscribers/ConfirmationEmailMailer.php b/lib/Subscribers/ConfirmationEmailMailer.php index 91de0b7cd3..879b1f246e 100644 --- a/lib/Subscribers/ConfirmationEmailMailer.php +++ b/lib/Subscribers/ConfirmationEmailMailer.php @@ -103,7 +103,7 @@ class ConfirmationEmailMailer { $this->mailer->getSenderNameAndAddress($from); $this->mailer->getReplyToNameAndAddress($reply_to); return $this->mailer->send($email, $subscriber); - } catch(\Exception $e) { + } catch (\Exception $e) { $subscriber->setError($e->getMessage()); return false; } diff --git a/lib/Subscribers/ImportExport/Export/Export.php b/lib/Subscribers/ImportExport/Export/Export.php index ae8c6ebb73..22f68f2280 100644 --- a/lib/Subscribers/ImportExport/Export/Export.php +++ b/lib/Subscribers/ImportExport/Export/Export.php @@ -64,7 +64,7 @@ class Export { 'generate' . strtoupper($this->export_format_option) ) ); - } catch(\Exception $e) { + } catch (\Exception $e) { throw new \Exception($e->getMessage()); } return array( diff --git a/lib/Subscribers/ImportExport/Import/Import.php b/lib/Subscribers/ImportExport/Import/Import.php index ad865baa53..8e9348dc0a 100644 --- a/lib/Subscribers/ImportExport/Import/Import.php +++ b/lib/Subscribers/ImportExport/Import/Import.php @@ -129,7 +129,7 @@ class Import { $this->synchronizeWPUsers($wp_users); } } - } catch(\Exception $e) { + } catch (\Exception $e) { throw new \Exception(__('Unable to save imported subscribers.', 'mailpoet')); } diff --git a/lib/Subscribers/NewSubscriberNotificationMailer.php b/lib/Subscribers/NewSubscriberNotificationMailer.php index b51f85aae5..470ab80281 100644 --- a/lib/Subscribers/NewSubscriberNotificationMailer.php +++ b/lib/Subscribers/NewSubscriberNotificationMailer.php @@ -65,7 +65,7 @@ class NewSubscriberNotificationMailer { try { $this->mailer->getSenderNameAndAddress($this->constructSenderEmail()); $this->mailer->send($this->constructNewsletter($subscriber, $segments), $settings['address']); - } catch(\Exception $e) { + } catch (\Exception $e) { if(WP_DEBUG) { throw $e; } diff --git a/tests/integration/API/APITest.php b/tests/integration/API/APITest.php index 9113123669..30ab5559d9 100644 --- a/tests/integration/API/APITest.php +++ b/tests/integration/API/APITest.php @@ -14,7 +14,7 @@ class APITest extends \MailPoetTest { try { API::MP('invalid_version'); $this->fail('Incorrect API version exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Invalid API version.'); } } diff --git a/tests/integration/API/JSON/v1/SubscribersTest.php b/tests/integration/API/JSON/v1/SubscribersTest.php index c900f0a05a..009a726088 100644 --- a/tests/integration/API/JSON/v1/SubscribersTest.php +++ b/tests/integration/API/JSON/v1/SubscribersTest.php @@ -534,7 +534,7 @@ class SubscribersTest extends \MailPoetTest { $this->obfuscatedSegments => array($this->segment_1->id, $this->segment_2->id) )); $this->fail('It should not be possible to subscribe a second time so soon'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('You need to wait 60 seconds before subscribing again.'); } } @@ -561,7 +561,7 @@ class SubscribersTest extends \MailPoetTest { $this->obfuscatedSegments => array($this->segment_1->id, $this->segment_2->id) )); $this->fail('It should not be possible to resubscribe a second time so soon'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('You need to wait 60 seconds before subscribing again.'); } } diff --git a/tests/integration/API/MP/APITest.php b/tests/integration/API/MP/APITest.php index 7dc3915f74..2a6bdf182c 100644 --- a/tests/integration/API/MP/APITest.php +++ b/tests/integration/API/MP/APITest.php @@ -61,7 +61,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists(false, array(1,2,3)); $this->fail('Subscriber does not exist exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This subscriber does not exist.'); } } @@ -74,14 +74,14 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists($subscriber->id, array(1,2,3)); $this->fail('Missing segments exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('These lists do not exist.'); } // single list error message try { $this->getApi()->subscribeToLists($subscriber->id, array(1)); $this->fail('Missing segments exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This list does not exist.'); } } @@ -99,7 +99,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists($subscriber->id, array($segment->id)); $this->fail('WP Users segment exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals("Can't subscribe to a WordPress Users list with ID {$segment->id}."); } } @@ -117,7 +117,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists($subscriber->id, array($segment->id)); $this->fail('WooCommerce Customers segment exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals("Can't subscribe to a WooCommerce Customers list with ID {$segment->id}."); } } @@ -136,14 +136,14 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists($subscriber->id, array($segment->id, 90, 100)); $this->fail('Missing segments with IDs exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Lists with IDs 90, 100 do not exist.'); } // single list error message try { $this->getApi()->subscribeToLists($subscriber->id, array($segment->id, 90)); $this->fail('Missing segments with IDs exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('List with ID 90 does not exist.'); } } @@ -182,7 +182,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->subscribeToLists($subscriber->id, array()); $this->fail('Segments are required exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('At least one segment ID is required.'); } @@ -307,7 +307,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->addSubscriber(array()); $this->fail('Subscriber email address required exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Subscriber email address is required.'); } } @@ -319,7 +319,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->addSubscriber(array('email' => $subscriber->email)); $this->fail('Subscriber exists exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This subscriber already exists.'); } } @@ -331,7 +331,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->addSubscriber($subscriber); $this->fail('Failed to add subscriber exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->contains('Failed to add subscriber:'); // error message (converted to lowercase) returned by the model expect($e->getMessage())->contains('your email address is invalid!'); @@ -525,7 +525,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->addList(array()); $this->fail('List name required exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('List name is required.'); } } @@ -537,7 +537,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->addList(array('name' => $segment->name)); $this->fail('List exists exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This list already exists.'); } } @@ -556,7 +556,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists(false, array(1,2,3)); $this->fail('Subscriber does not exist exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This subscriber does not exist.'); } } @@ -569,14 +569,14 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists($subscriber->id, array(1,2,3)); $this->fail('Missing segments exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('These lists do not exist.'); } // single list error message try { $this->getApi()->unsubscribeFromLists($subscriber->id, array(1)); $this->fail('Missing segments exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This list does not exist.'); } } @@ -595,14 +595,14 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists($subscriber->id, array($segment->id, 90, 100)); $this->fail('Missing segments with IDs exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Lists with IDs 90, 100 do not exist.'); } // single list error message try { $this->getApi()->unsubscribeFromLists($subscriber->id, array($segment->id, 90)); $this->fail('Missing segments with IDs exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('List with ID 90 does not exist.'); } } @@ -620,7 +620,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists($subscriber->id, array($segment->id)); $this->fail('WP Users segment exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals("Can't unsubscribe from a WordPress Users list with ID {$segment->id}."); } } @@ -638,7 +638,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists($subscriber->id, array($segment->id)); $this->fail('WooCommerce Customers segment exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals("Can't unsubscribe from a WooCommerce Customers list with ID {$segment->id}."); } } @@ -676,7 +676,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->unsubscribeFromLists($subscriber->id, array()); $this->fail('Segments are required exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('At least one segment ID is required.'); } @@ -707,7 +707,7 @@ class APITest extends \MailPoetTest { try { $this->getApi()->getSubscriber('some_fake_email'); $this->fail('Subscriber does not exist exception should have been thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('This subscriber does not exist.'); } } diff --git a/tests/integration/Config/DatabaseTest.php b/tests/integration/Config/DatabaseTest.php index 4b441efafa..02ecbb0cd1 100644 --- a/tests/integration/Config/DatabaseTest.php +++ b/tests/integration/Config/DatabaseTest.php @@ -76,7 +76,7 @@ class DatabaseTest extends \MailPoetTest { try { $this->database->setupDriverOptions(); $this->fail('Exception was not thrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e instanceof \PDOException)->false(); expect($e->getMessage())->equals($message); } diff --git a/tests/integration/Config/RendererTest.php b/tests/integration/Config/RendererTest.php index 7f8ae98426..b51516539e 100644 --- a/tests/integration/Config/RendererTest.php +++ b/tests/integration/Config/RendererTest.php @@ -109,7 +109,7 @@ class RendererTest extends \MailPoetTest { try { $renderer->render('non-existing-template.html', array('somekey' => 'someval')); self::fail('Twig exception was not rethrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->contains($exception_message); expect($e->getMessage())->notEquals($exception_message); } diff --git a/tests/integration/Cron/CronHelperTest.php b/tests/integration/Cron/CronHelperTest.php index f9896139d7..7c5e5b26a2 100644 --- a/tests/integration/Cron/CronHelperTest.php +++ b/tests/integration/Cron/CronHelperTest.php @@ -240,7 +240,7 @@ class CronHelperTest extends \MailPoetTest { try { CronHelper::getSiteUrl($site_url); self::fail('Site URL is unreachable exception not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Site URL is unreachable.'); } } @@ -257,7 +257,7 @@ class CronHelperTest extends \MailPoetTest { try { CronHelper::enforceExecutionLimit($time - CronHelper::DAEMON_EXECUTION_LIMIT); self::fail('Execution limit exception not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Maximum execution time has been reached.'); } } diff --git a/tests/integration/Cron/Workers/SchedulerTest.php b/tests/integration/Cron/Workers/SchedulerTest.php index 5b42262c99..3d9e3f03ba 100644 --- a/tests/integration/Cron/Workers/SchedulerTest.php +++ b/tests/integration/Cron/Workers/SchedulerTest.php @@ -37,7 +37,7 @@ class SchedulerTest extends \MailPoetTest { try { $scheduler = new Scheduler(microtime(true) - CronHelper::DAEMON_EXECUTION_LIMIT); self::fail('Maximum execution time limit exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Maximum execution time has been reached.'); } } @@ -525,7 +525,7 @@ class SchedulerTest extends \MailPoetTest { try { $scheduler->process(); self::fail('Maximum execution time limit exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Maximum execution time has been reached.'); } } diff --git a/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php b/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php index 53b5592642..c890a7ddda 100644 --- a/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php +++ b/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php @@ -132,7 +132,7 @@ class SendingQueueTest extends \MailPoetTest { try { $sending_queue_worker->process(); self::fail('Execution limits function was not called.'); - } catch(\Exception $e) { + } catch (\Exception $e) { // No exception handling needed } } @@ -630,7 +630,7 @@ class SendingQueueTest extends \MailPoetTest { $statistics = [] ); $this->fail('Paused sending exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending has been paused.'); } $mailer_log = MailerLog::getMailerLog(); diff --git a/tests/integration/Cron/Workers/SendingQueue/Tasks/NewsletterTest.php b/tests/integration/Cron/Workers/SendingQueue/Tasks/NewsletterTest.php index 7782f894f7..0900fb62a1 100644 --- a/tests/integration/Cron/Workers/SendingQueue/Tasks/NewsletterTest.php +++ b/tests/integration/Cron/Workers/SendingQueue/Tasks/NewsletterTest.php @@ -316,7 +316,7 @@ class NewsletterTest extends \MailPoetTest { try { $this->newsletter_task->preProcessNewsletter($this->newsletter, $queue); self::fail('Sending error exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { $mailer_log = MailerLog::getMailerLog(); expect($mailer_log['error']['operation'])->equals('queue_save'); expect($mailer_log['error']['error_message'])->equals('There was an error processing your newsletter during sending. If possible, please contact us and report this issue.'); @@ -334,7 +334,7 @@ class NewsletterTest extends \MailPoetTest { try { $this->newsletter_task->preProcessNewsletter($this->newsletter, $queue_mock); self::fail('Sending error exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { $mailer_log = MailerLog::getMailerLog(); expect($mailer_log['error']['operation'])->equals('queue_save'); expect($mailer_log['error']['error_message'])->equals('There was an error processing your newsletter during sending. If possible, please contact us and report this issue.'); @@ -357,7 +357,7 @@ class NewsletterTest extends \MailPoetTest { try { $this->newsletter_task->preProcessNewsletter($this->newsletter, $queue_mock); self::fail('Sending error exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { $mailer_log = MailerLog::getMailerLog(); expect($mailer_log['error']['operation'])->equals('queue_save'); expect($mailer_log['error']['error_message'])->equals('There was an error processing your newsletter during sending. If possible, please contact us and report this issue.'); diff --git a/tests/integration/Cron/Workers/SimpleWorkerTest.php b/tests/integration/Cron/Workers/SimpleWorkerTest.php index 7c108b7c94..f84602bbce 100644 --- a/tests/integration/Cron/Workers/SimpleWorkerTest.php +++ b/tests/integration/Cron/Workers/SimpleWorkerTest.php @@ -28,7 +28,7 @@ class SimpleWorkerTest extends \MailPoetTest { $worker_class = get_class($worker); new $worker_class(); $this->fail('SimpleWorker did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Constant TASK_TYPE is not defined on subclass ' . $worker_class); } } @@ -43,7 +43,7 @@ class SimpleWorkerTest extends \MailPoetTest { microtime(true) - CronHelper::DAEMON_EXECUTION_LIMIT ); self::fail('Maximum execution time limit exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Maximum execution time has been reached.'); } } diff --git a/tests/integration/Mailer/MailerLogTest.php b/tests/integration/Mailer/MailerLogTest.php index 72ca31709e..512eabc57a 100644 --- a/tests/integration/Mailer/MailerLogTest.php +++ b/tests/integration/Mailer/MailerLogTest.php @@ -196,7 +196,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::processError($operation = 'send', $error = 'email rejected - sending paused', $error_code = null, $pause_sending = true); $this->fail('Paused sending exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending has been paused.'); } $mailer_log = MailerLog::getMailerLog(); @@ -228,7 +228,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::enforceExecutionRequirements(); self::fail('Sending frequency exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending frequency limit has been reached.'); } } @@ -250,7 +250,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::enforceExecutionRequirements(); self::fail('Sending frequency exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending frequency limit has been reached.'); } } @@ -271,7 +271,7 @@ class MailerLogTest extends \MailPoetTest { // sending limit exception should not be thrown try { MailerLog::enforceExecutionRequirements(); - } catch(\Exception $e) { + } catch (\Exception $e) { self::fail('Sending frequency exception was thrown.'); } } @@ -283,7 +283,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::enforceExecutionRequirements($mailer_log); self::fail('Sending waiting to be retried exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending is waiting to be retried.'); } } @@ -298,7 +298,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::enforceExecutionRequirements($mailer_log); self::fail('Sending paused exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending has been paused.'); } $mailer_log = MailerLog::getMailerLog(); @@ -324,7 +324,7 @@ class MailerLogTest extends \MailPoetTest { try { MailerLog::enforceExecutionRequirements($mailer_log); self::fail('Sending paused exception was not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sending has been paused.'); } } diff --git a/tests/integration/Mailer/MailerTest.php b/tests/integration/Mailer/MailerTest.php index 1e42e570f9..51be22088a 100644 --- a/tests/integration/Mailer/MailerTest.php +++ b/tests/integration/Mailer/MailerTest.php @@ -72,7 +72,7 @@ class MailerTest extends \MailPoetTest { try { $mailer = new Mailer(); $this->fail('Mailer did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Mailer is not configured.'); } } @@ -81,7 +81,7 @@ class MailerTest extends \MailPoetTest { try { $mailer = new Mailer($mailer = $this->mailer); $this->fail('Mailer did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Sender name and email are not configured.'); } } @@ -108,7 +108,7 @@ class MailerTest extends \MailPoetTest { try { $mailer = new Mailer(array('method' => 'Unknown'), $this->sender); $this->fail('Mailer did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Mailing method does not exist.'); } } diff --git a/tests/integration/Mailer/Methods/AmazonSESTest.php b/tests/integration/Mailer/Methods/AmazonSESTest.php index 664c251482..be1a67e3e2 100644 --- a/tests/integration/Mailer/Methods/AmazonSESTest.php +++ b/tests/integration/Mailer/Methods/AmazonSESTest.php @@ -91,7 +91,7 @@ class AmazonSESTest extends \MailPoetTest { new AmazonSESMapper() ); $this->fail('Unsupported region exception was not thrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Unsupported Amazon SES region'); } } diff --git a/tests/integration/Models/ModelTest.php b/tests/integration/Models/ModelTest.php index 51c9a0dc4c..02359f1cf2 100644 --- a/tests/integration/Models/ModelTest.php +++ b/tests/integration/Models/ModelTest.php @@ -20,7 +20,7 @@ class ModelTest extends \MailPoetTest { try { $model::findMany(); $this->fail('Exception was not thrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e instanceof \PDOException)->false(); expect($e->getMessage())->equals($message); } @@ -86,4 +86,4 @@ class ModelTest extends \MailPoetTest { function _after() { \ORM::setDb(null); } -} \ No newline at end of file +} diff --git a/tests/integration/Subscribers/ImportExport/Export/ExportTest.php b/tests/integration/Subscribers/ImportExport/Export/ExportTest.php index e51fae8cce..86f1805cab 100644 --- a/tests/integration/Subscribers/ImportExport/Export/ExportTest.php +++ b/tests/integration/Subscribers/ImportExport/Export/ExportTest.php @@ -197,7 +197,7 @@ class ExportTest extends \MailPoetTest { $this->export->export_path = '/fake_folder'; $this->export->process(); $this->fail('Export did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage()) ->equals("The export file could not be saved on the server."); } @@ -208,7 +208,7 @@ class ExportTest extends \MailPoetTest { $this->export->export_file = $this->export->getExportFile('csv'); $this->export->export_format_option = 'csv'; $result = $this->export->process(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->fail('Export to .csv process threw an exception'); } expect($result['totalExported'])->equals(4); @@ -218,7 +218,7 @@ class ExportTest extends \MailPoetTest { $this->export->export_file = $this->export->getExportFile('xlsx'); $this->export->export_format_option = 'xlsx'; $result = $this->export->process(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->fail('Export to .xlsx process threw an exception'); } expect($result['totalExported'])->equals(4); diff --git a/tests/integration/Subscribers/ImportExport/Import/ImportTest.php b/tests/integration/Subscribers/ImportExport/Import/ImportTest.php index 5088292ee1..cc6bd7e861 100644 --- a/tests/integration/Subscribers/ImportExport/Import/ImportTest.php +++ b/tests/integration/Subscribers/ImportExport/Import/ImportTest.php @@ -73,7 +73,7 @@ class ImportTest extends \MailPoetTest { try { $this->import->validateImportData($data); self::fail('Missing or invalid data exception not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Missing or invalid import data.'); } // exception should not be thrown when all fields exist @@ -86,7 +86,7 @@ class ImportTest extends \MailPoetTest { try { $this->import->validateImportData($data); self::fail('Missing or invalid data exception not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('Missing or invalid import data.'); } } @@ -135,7 +135,7 @@ class ImportTest extends \MailPoetTest { try { $import->process(); self::fail('No valid subscribers found exception not thrown.'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->equals('No valid subscribers were found.'); } } diff --git a/tests/integration/Subscribers/ImportExport/Import/MailChimpTest.php b/tests/integration/Subscribers/ImportExport/Import/MailChimpTest.php index f9214f9bc7..2c6550aebf 100644 --- a/tests/integration/Subscribers/ImportExport/Import/MailChimpTest.php +++ b/tests/integration/Subscribers/ImportExport/Import/MailChimpTest.php @@ -44,7 +44,7 @@ class MailChimpTest extends \MailPoetTest { $mailchimp->api_key = false; $lists = $mailchimp->getLists(); $this->fail('MailChimp getLists() did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->contains('Invalid API Key'); } } @@ -53,7 +53,7 @@ class MailChimpTest extends \MailPoetTest { if(getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return; try { $lists = $this->mailchimp->getLists(); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->fail('MailChimp getLists() threw an exception'); } expect($lists)->count(2); @@ -67,14 +67,14 @@ class MailChimpTest extends \MailPoetTest { try { $subscribers = $this->mailchimp->getSubscribers(); $this->fail('MailChimp getSubscribers() did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->contains('Did not find any valid lists'); } try { $subscribers = $this->mailchimp->getSubscribers(array(12)); $this->fail('MailChimp getSubscribers() did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage())->contains('Did not find any valid lists'); } } @@ -84,7 +84,7 @@ class MailChimpTest extends \MailPoetTest { try { $subscribers = $this->mailchimp->getSubscribers(array($this->lists[0])); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->fail('MailChimp getSubscribers() threw an exception'); } @@ -101,7 +101,7 @@ class MailChimpTest extends \MailPoetTest { try { $subscribers = $this->mailchimp->getSubscribers($this->lists); $this->fail('MailChimp getSubscribers() did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage()) ->contains('The selected lists do not have matching columns (headers)'); } @@ -115,9 +115,9 @@ class MailChimpTest extends \MailPoetTest { try { $subscribers = $mailchimp->getSubscribers($this->lists); $this->fail('MailChimp getSubscribers() did not throw an exception'); - } catch(\Exception $e) { + } catch (\Exception $e) { expect($e->getMessage()) ->contains('The information received from MailChimp is too large for processing'); } } -} \ No newline at end of file +} diff --git a/tests/integration/Tasks/SendingTest.php b/tests/integration/Tasks/SendingTest.php index a9830f4d4d..7918d98684 100644 --- a/tests/integration/Tasks/SendingTest.php +++ b/tests/integration/Tasks/SendingTest.php @@ -38,7 +38,7 @@ class SendingTest extends \MailPoetTest { try { $sending = SendingTask::create($this->task, $this->queue); $this->fail('Exception was not thrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { // No exception handling necessary } } diff --git a/tests/integration/Tasks/Subscribers/BatchIteratorTest.php b/tests/integration/Tasks/Subscribers/BatchIteratorTest.php index a47a70d647..e76b398dad 100644 --- a/tests/integration/Tasks/Subscribers/BatchIteratorTest.php +++ b/tests/integration/Tasks/Subscribers/BatchIteratorTest.php @@ -23,7 +23,7 @@ class BatchIteratorTest extends \MailPoetTest { try { $iterator = new BatchIterator(0, 0); $this->fail('Exception was not thrown'); - } catch(\Exception $e) { + } catch (\Exception $e) { // No exception handling necessary } }