PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Common / Helpers / Import / FormImportSourceInterface.php

FormImportSourceInterface.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/Common/Helpers/Import/FormImportSourceInterface.php

43 lines 1012 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Common\Helpers\Import;
4
5 // phpcs:disable PSR1.Files.SideEffects
6
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10
11 /**
12 * Contract for a form import source (IvyForms native or third-party builder).
13 *
14 * Each source owns its own detection and normalization so new builders can
15 * register without extending a shared switch.
16 */
17 interface FormImportSourceInterface
18 {
19 /**
20 * Stable source identifier (e.g. ivyforms, wsform, fluentforms).
21 *
22 * @return string
23 */
24 public function getId(): string;
25
26 /**
27 * Whether this source can handle the decoded import payload.
28 *
29 * @param array<string|int, mixed> $importData
30 * @return bool
31 */
32 public function matches(array $importData): bool;
33
34 /**
35 * Convert the payload into the IvyForms import structure
36 * (`['forms' => [...]]`).
37 *
38 * @param array<string|int, mixed> $importData
39 * @return array<string, mixed>
40 */
41 public function normalize(array $importData): array;
42 }
43