Problem/Motivation
The definition has the key type
which is intended to be an array, which isn't clear at all. If someone makes a mistake there is a WSOD due to passing a string to in_array
if ($definition['type'] === FALSE || in_array($type, $definition['type'])) {
$definitions[$plugin_id] = $definition;
}
Steps to reproduce
See https://git.drupalcode.org/project/experience_builder/-/merge_requests/786
Proposed resolution
Cast type
to an array, always. Or provide validation and error with an exception to clearly state what must be fixed.