Skip to content

Commit c5e3f8a

Browse files
committed
Cleaned up
1 parent e384185 commit c5e3f8a

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

src/Helper/WebformHelper.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -84,46 +84,6 @@ public function webformIsPublished(WebformInterface $webform): bool {
8484
return (bool) ($webform->getThirdPartySetting('os2forms', 'os2forms_sync')['publish'] ?? FALSE);
8585
}
8686

87-
/**
88-
* Webform to array.
89-
*
90-
* @phpstan-return array<string, mixed>
91-
*/
92-
public function webformToArray(WebformInterface $webform): array {
93-
$data = array_filter(
94-
$webform->toArray(),
95-
static function ($key) {
96-
return in_array($key, [
97-
'id',
98-
'uuid',
99-
'title',
100-
'description',
101-
'category',
102-
'elements',
103-
]);
104-
},
105-
ARRAY_FILTER_USE_KEY
106-
);
107-
108-
if (isset($data['elements'])) {
109-
try {
110-
$data['elements'] = Yaml::decode($data['elements']);
111-
}
112-
catch (InvalidDataTypeException $invalidDataTypeException) {
113-
}
114-
}
115-
116-
$url = Url::fromRoute('os2forms_sync.jsonapi.webform.show', ['webform' => $webform->id()],
117-
['absolute' => TRUE])->toString();
118-
119-
return [
120-
'data' => $data,
121-
'links' => [
122-
'self' => $url,
123-
],
124-
];
125-
}
126-
12787
/**
12888
* Implements hook_webform_third_party_settings_form_alter().
12989
*

0 commit comments

Comments
 (0)