core/modules/media_library/src/Form/AddFormBase.php | 6 +++--- core/modules/media_library/src/Form/FileUploadForm.php | 4 ++-- core/modules/media_library/src/Form/OEmbedForm.php | 4 ++-- core/modules/media_library/src/MediaLibraryOpenerInterface.php | 4 ++-- core/modules/media_library/src/MediaLibraryState.php | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/modules/media_library/src/Form/AddFormBase.php b/core/modules/media_library/src/Form/AddFormBase.php index 92a1ba279e..b5105b7880 100644 --- a/core/modules/media_library/src/Form/AddFormBase.php +++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -71,8 +71,8 @@ abstract class AddFormBase extends FormBase { * The entity type manager. * @param \Drupal\media_library\MediaLibraryUiBuilder $library_ui_builder * The media library UI builder. - * @param \Drupal\Core\DependencyInjection\ClassResolverInterface|null $class_resolver - * (optional) The class resolver. + * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver + * The class resolver. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, MediaLibraryUiBuilder $library_ui_builder, ClassResolverInterface $class_resolver = NULL) { $this->entityTypeManager = $entity_type_manager; @@ -746,7 +746,7 @@ public function updateWidget(array &$form, FormStateInterface $form_state) { return $media->id(); }, $this->getCurrentMediaItems($form_state)); - // Allow the opener service to handle the selection. + // Allow the opener service to respond to the selection. $media_library_state = $this->getMediaLibraryState($form_state); $service_id = $media_library_state->getOpenerId(); return $this->classResolver->getInstanceFromDefinition($service_id) diff --git a/core/modules/media_library/src/Form/FileUploadForm.php b/core/modules/media_library/src/Form/FileUploadForm.php index 67bd7ce489..11f5e8e21b 100644 --- a/core/modules/media_library/src/Form/FileUploadForm.php +++ b/core/modules/media_library/src/Form/FileUploadForm.php @@ -66,8 +66,8 @@ class FileUploadForm extends AddFormBase { * The renderer service. * @param \Drupal\Core\File\FileSystemInterface $file_system * The file system service. - * @param \Drupal\Core\DependencyInjection\ClassResolverInterface|null $class_resolver - * (optional) The class resolver. + * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver + * The class resolver. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, MediaLibraryUiBuilder $library_ui_builder, ElementInfoManagerInterface $element_info, RendererInterface $renderer, FileSystemInterface $file_system, ClassResolverInterface $class_resolver = NULL) { parent::__construct($entity_type_manager, $library_ui_builder, $class_resolver); diff --git a/core/modules/media_library/src/Form/OEmbedForm.php b/core/modules/media_library/src/Form/OEmbedForm.php index 68cf73e35a..bfa2e8a153 100644 --- a/core/modules/media_library/src/Form/OEmbedForm.php +++ b/core/modules/media_library/src/Form/OEmbedForm.php @@ -49,8 +49,8 @@ class OEmbedForm extends AddFormBase { * The oEmbed URL resolver service. * @param \Drupal\media\OEmbed\ResourceFetcherInterface $resource_fetcher * The oEmbed resource fetcher service. - * @param \Drupal\Core\DependencyInjection\ClassResolverInterface|null $class_resolver - * (optional) The class resolver. + * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver + * The class resolver. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, MediaLibraryUiBuilder $library_ui_builder, UrlResolverInterface $url_resolver, ResourceFetcherInterface $resource_fetcher, ClassResolverInterface $class_resolver = NULL) { parent::__construct($entity_type_manager, $library_ui_builder, $class_resolver); diff --git a/core/modules/media_library/src/MediaLibraryOpenerInterface.php b/core/modules/media_library/src/MediaLibraryOpenerInterface.php index 1c39fa4485..dc9708c3c5 100644 --- a/core/modules/media_library/src/MediaLibraryOpenerInterface.php +++ b/core/modules/media_library/src/MediaLibraryOpenerInterface.php @@ -13,8 +13,8 @@ * - when used in an entity reference field widget; * - when used in a text editor. * - * Openers that require special parameters or metadata should retrieve them from - * the MediaLibraryState object. + * Openers that require additional parameters or metadata should retrieve them + * from the MediaLibraryState object. * * @see \Drupal\media_library\MediaLibraryState::getOpenerParameter() */ diff --git a/core/modules/media_library/src/MediaLibraryState.php b/core/modules/media_library/src/MediaLibraryState.php index 83c8a412fd..9f668cdfd7 100644 --- a/core/modules/media_library/src/MediaLibraryState.php +++ b/core/modules/media_library/src/MediaLibraryState.php @@ -30,10 +30,10 @@ * the number of remaining slots is a negative number, an unlimited amount of * items can be selected. * - * This object can also carry an optional array of arbitrary values, under the - * media_library_opener_parameters key. These values are included in the hash - * generated by ::getHash(), but not otherwise validated by this object. They - * may be validated or used in specialized ways by specific opener services. + * This object can also carry an optional opener-specific array of arbitrary + * values, under the media_library_opener_parameters key. These values are + * included in the hash generated by ::getHash(), so the end user cannot tamper + * with them either. * * @see \Drupal\media_library\MediaLibraryOpenerInterface * @@ -179,7 +179,7 @@ protected function validateRequiredParameters($opener_id, array $allowed_media_t */ public function getHash() { // Create a hash from the required state parameters and the serialized - // opener-specific parameters. + // optional opener-specific parameters. $hash = implode(':', [ $this->getOpenerId(), implode(':', $this->getAllowedTypeIds()),