@@ -104,7 +104,7 @@ |
||
| 104 | 104 | |
| 105 | 105 | protected static function defineSources(string $context = null): array |
| 106 | 106 | { |
| 107 | - $forms = array_unique(array_map(function (ContactFormSubmission $submission) { |
|
| 107 | + $forms = array_unique(array_map(function(ContactFormSubmission $submission) { |
|
| 108 | 108 | return $submission->form; |
| 109 | 109 | }, self::find()->all())); |
| 110 | 110 | |
@@ -84,18 +84,18 @@ discard block |
||
| 84 | 84 | Craft::$app->session->setNotice(Craft::t('contact-form-extensions', 'The Contact Form plugin is not installed or activated, Contact Form Extensions does not work without it.')); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function (RegisterUrlRulesEvent $event) { |
|
| 87 | + Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function(RegisterUrlRulesEvent $event) { |
|
| 88 | 88 | $event->rules = array_merge($event->rules, [ |
| 89 | 89 | 'contact-form-extensions/submissions/<submissionId:\d+>' => 'contact-form-extensions/submissions/show-submission', |
| 90 | 90 | 'contact-form-extensions/submissions/<submissionId:\d+>/<siteHandle:{handle}>' => 'contact-form-extensions/submissions/show-submission', |
| 91 | 91 | ]); |
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | - Event::on(Submission::class, Submission::EVENT_BEFORE_VALIDATE, function (ModelEvent $e) { |
|
| 94 | + Event::on(Submission::class, Submission::EVENT_BEFORE_VALIDATE, function(ModelEvent $e) { |
|
| 95 | 95 | // Do something |
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - Event::on(Mailer::class, Mailer::EVENT_BEFORE_SEND, function (SendEvent $e) { |
|
| 98 | + Event::on(Mailer::class, Mailer::EVENT_BEFORE_SEND, function(SendEvent $e) { |
|
| 99 | 99 | $submission = $e->submission; |
| 100 | 100 | if ($this->settings->enableDatabase) { |
| 101 | 101 | $submission = $this->contactFormExtensionsService->saveSubmission($submission); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | 121 | |
| 122 | - Event::on(Mailer::class, Mailer::EVENT_AFTER_SEND, function (SendEvent $e) { |
|
| 122 | + Event::on(Mailer::class, Mailer::EVENT_AFTER_SEND, function(SendEvent $e) { |
|
| 123 | 123 | if ($this->settings->enableConfirmationEmail) { |
| 124 | 124 | // First set the template mode to the Site templates |
| 125 | 125 | Craft::$app->view->setTemplateMode(View::TEMPLATE_MODE_SITE); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | Event::on( |
| 149 | 149 | CraftVariable::class, |
| 150 | 150 | CraftVariable::EVENT_INIT, |
| 151 | - function (Event $event) { |
|
| 151 | + function(Event $event) { |
|
| 152 | 152 | /** @var CraftVariable $variable */ |
| 153 | 153 | $variable = $event->sender; |
| 154 | 154 | $variable->set('contactFormExtensions', ContactFormExtensionsVariable::class); |