PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.6
JetFormBuilder — Dynamic Blocks Form Builder v3.4.6
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 All 130 releases
jetformbuilder / includes / actions / legacy-request-data.php
legacy-request-data.php
95 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
4 namespace Jet_Form_Builder\Actions;
5
6 // If this file is called directly, abort.
7 use JFB_Modules\Block_Parsers\Field_Data_Parser;
8
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 class Legacy_Request_Data implements \Iterator, \ArrayAccess {
14
15 /**
16 * @return mixed
17 */
18 #[\ReturnTypeWillChange]
19 public function current() {
20 $parser = current( jet_fb_context()->parsers );
21
22 return ( $parser instanceof Field_Data_Parser ) ? $parser->get_value() : $parser;
23 }
24
25 #[\ReturnTypeWillChange]
26 public function next() {
27 next( jet_fb_context()->parsers );
28 }
29
30 /**
31 * @return bool|float|int|string|null
32 */
33 #[\ReturnTypeWillChange]
34 public function key() {
35 return key( jet_fb_context()->parsers );
36 }
37
38 /**
39 * @return bool
40 */
41 public function valid(): bool {
42 return $this->key() !== null;
43 }
44
45 #[\ReturnTypeWillChange]
46 public function rewind() {
47 reset( jet_fb_context()->parsers );
48 }
49
50 /*
51 * \ArrayAccess
52 */
53
54 /**
55 * @param mixed $offset
56 *
57 * @return bool
58 */
59 public function offsetExists( $offset ): bool {
60 return jet_fb_context()->has_field( $offset );
61 }
62
63 /**
64 * @param mixed $offset
65 *
66 * @return mixed
67 */
68 #[\ReturnTypeWillChange]
69 public function offsetGet( $offset ) {
70 return jet_fb_context()->get_value( $offset );
71 }
72
73 /**
74 * @param mixed $offset
75 * @param mixed $value
76 */
77 #[\ReturnTypeWillChange]
78 public function offsetSet( $offset, $value ) {
79 if ( is_null( $offset ) ) {
80 return;
81 }
82
83 jet_fb_context()->update_request( $value, $offset );
84 }
85
86 /**
87 * @param mixed $offset
88 */
89 #[\ReturnTypeWillChange]
90 public function offsetUnset( $offset ) {
91 jet_fb_context()->remove( $offset );
92 }
93
94 }
95