summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/media_library/src/OpenerResolverInterface.php
blob: 4a877f68eccb8638fea46fbe743caad560f9f266 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace Drupal\media_library;

/**
 * Defines an interface to get a media library opener from the container.
 *
 * This is intended to be a very thin interface-verifying wrapper around
 * services which implement \Drupal\media_library\MediaLibraryOpenerInterface.
 * It is not an API and should not be extended or used by code that does not
 * interact with the Media Library module.
 *
 * @internal
 *   This interface is an internal part of the modal media library dialog and
 *   is only implemented by \Drupal\media_library\OpenerResolver. It is not a
 *   public API.
 */
interface OpenerResolverInterface {

  /**
   * Gets a media library opener service from the container.
   *
   * @param \Drupal\media_library\MediaLibraryState $state
   *   A value object representing the state of the media library.
   *
   * @return \Drupal\media_library\MediaLibraryOpenerInterface
   *   The media library opener service.
   *
   * @throws \RuntimeException
   *   If the requested opener service does not implement
   *   \Drupal\media_library\MediaLibraryOpenerInterface.
   */
  public function get(MediaLibraryState $state);

}