Mercurial > hg > isophonics-drupal-site
annotate core/modules/media/src/OEmbed/ResourceFetcherInterface.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@17 | 1 <?php |
Chris@17 | 2 |
Chris@17 | 3 namespace Drupal\media\OEmbed; |
Chris@17 | 4 |
Chris@17 | 5 /** |
Chris@17 | 6 * Defines an interface for an oEmbed resource fetcher service. |
Chris@17 | 7 * |
Chris@17 | 8 * The resource fetcher's only responsibility is to retrieve oEmbed resource |
Chris@17 | 9 * data from an endpoint URL (i.e., as returned by |
Chris@17 | 10 * \Drupal\media\OEmbed\UrlResolverInterface::getResourceUrl()) and return a |
Chris@17 | 11 * \Drupal\media\OEmbed\Resource value object. |
Chris@17 | 12 */ |
Chris@17 | 13 interface ResourceFetcherInterface { |
Chris@17 | 14 |
Chris@17 | 15 /** |
Chris@17 | 16 * Fetches an oEmbed resource. |
Chris@17 | 17 * |
Chris@17 | 18 * @param string $url |
Chris@17 | 19 * Endpoint-specific URL of the oEmbed resource. |
Chris@17 | 20 * |
Chris@17 | 21 * @return \Drupal\media\OEmbed\Resource |
Chris@17 | 22 * A resource object built from the oEmbed resource data. |
Chris@17 | 23 * |
Chris@17 | 24 * @see https://oembed.com/#section2 |
Chris@17 | 25 * |
Chris@17 | 26 * @throws \Drupal\media\OEmbed\ResourceException |
Chris@17 | 27 * If the oEmbed endpoint is not reachable or the response returns an |
Chris@17 | 28 * unexpected Content-Type header. |
Chris@17 | 29 */ |
Chris@17 | 30 public function fetchResource($url); |
Chris@17 | 31 |
Chris@17 | 32 } |