Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / media / src / OEmbed / UrlResolverInterface.php
1 <?php
2
3 namespace Drupal\media\OEmbed;
4
5 /**
6  * Defines the interface for the oEmbed URL resolver service.
7  *
8  * The URL resolver is responsible for converting oEmbed-compatible media asset
9  * URLs into canonical resource URLs, at which an oEmbed representation of the
10  * asset can be retrieved.
11  */
12 interface UrlResolverInterface {
13
14   /**
15    * Tries to determine the oEmbed provider for a media asset URL.
16    *
17    * @param string $url
18    *   The media asset URL.
19    *
20    * @return \Drupal\media\OEmbed\Provider
21    *   The oEmbed provider for the asset.
22    *
23    * @throws \Drupal\media\OEmbed\ResourceException
24    *   If the provider cannot be determined.
25    * @throws \Drupal\media\OEmbed\ProviderException
26    *   If tne oEmbed provider causes an error.
27    */
28   public function getProviderByUrl($url);
29
30   /**
31    * Builds the resource URL for a media asset URL.
32    *
33    * @param string $url
34    *   The media asset URL.
35    * @param int $max_width
36    *   (optional) Maximum width of the oEmbed resource, in pixels.
37    * @param int $max_height
38    *   (optional) Maximum height of the oEmbed resource, in pixels.
39    *
40    * @return string
41    *   Returns the resource URL corresponding to the given media item URL.
42    */
43   public function getResourceUrl($url, $max_width = NULL, $max_height = NULL);
44
45 }