PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
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
← All changes | app/Services/FormBuilder/NotificationParser.php +22 -17 3.6.516.2.14 View file →
@@ -5,31 +5,36 @@
5 5 use FluentForm\App\Services\FormBuilder\ShortCodeParser;
6 6
7 7 class NotificationParser
8 8 {
9 - protected static $cache = null;
9 + protected static $cache = null;
10 10
11 - /**
12 - * Parse Norifications
13 - * @param array $notifications
14 - * @param int $insertId
15 - * @param array $data
11 + /**
12 + * Parse Norifications
13 + *
14 + * @param array $notifications
15 + * @param int $insertId
16 + * @param array $data
16 17 * @param object $form
17 - * @return bool $cache
18 - */
19 - public static function parse($notifications, $insertId, $data, $form, $cache = true)
18 + *
19 + * @return bool $cache
20 + */
21 + public static function parse($notifications, $insertId, $data, $form, $cache = true)
20 22 {
21 - if ($cache && !is_null(static::$cache)) {
22 - return static::$cache;
23 - }
23 + if ($cache && ! is_null(static::$cache)) {
24 + return static::$cache;
25 + }
24 26
25 27 foreach ($notifications as &$notification) {
26 28 static::setRecepient($notification, $data);
27 29
28 - $notification = ShortCodeParser::parse(
29 - $notification, $insertId, $data, $form
30 - );
31 - }
30 + $notification = ShortCodeParser::parse(
31 + $notification,
32 + $insertId,
33 + $data,
34 + $form
35 + );
36 + }
32 37
33 38 return $cache ? (static::$cache = $notifications) : $notifications;
34 39 }
35 40
@@ -34,9 +39,9 @@
34 39 }
35 40
36 41 protected static function setRecepient(&$notification, $data)
37 42 {
38 - if (isset($notification['sendTo']) && $notification['sendTo']['type'] == 'field') {
43 + if (isset($notification['sendTo']) && 'field' == $notification['sendTo']['type']) {
39 44 $notification['sendTo']['email'] = $data[$notification['sendTo']['field']];
40 45 }
41 46 }
42 47 }