PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.7
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.7
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / Integrations / LogResponseTrait.php

LogResponseTrait.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.7, at app/Services/Integrations/LogResponseTrait.php

58 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Services\Integrations;
4
5
6 /**
7 * @deprecated deprecated use FluentForm\App\Http\Controllers\GlobalIntegrationController;
8 */
9
10
11 trait LogResponseTrait
12 {
13 protected function logResponse($response, $feed, $data, $form, $entryId, $status)
14 {
15 if (! $response) {
16 return;
17 }
18
19 $prefix = 'fluentform/after_submission_api_response_';
20 $action = $prefix . $status;
21
22 do_action_deprecated(
23 'fluentform_after_submission_api_response_'. $status,
24 [
25 $form,
26 $entryId,
27 $data,
28 $feed,
29 $response,
30 $this->getApiResponseMessage($response, $status)
31 ],
32 FLUENTFORM_FRAMEWORK_UPGRADE,
33 $action,
34 'Use ' . $action . ' instead of fluentform_after_submission_api_response_'. $status
35 );
36
37 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Dynamic hook name constructed from deprecated hook
38 do_action(
39 $action, // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Dynamic hook name constructed from deprecated hook
40 $form,
41 $entryId,
42 $data,
43 $feed,
44 $response,
45 $this->getApiResponseMessage($response, $status)
46 );
47 }
48
49 protected function getApiResponseMessage($response, $status)
50 {
51 if (is_array($response) && isset($response['message'])) {
52 return $response['message'];
53 }
54
55 return $status;
56 }
57 }
58