public functionget(MediaLibraryState $state) {
$service_id = $state->getOpenerId();
$service = $this->openers[$service_id] ?? NULL;
if ($service instanceof MediaLibraryOpenerInterface) {
return$service;
}
thrownew\RuntimeException("{$service_id} must be an instance of " . MediaLibraryOpenerInterface::class);
}