Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / media / src / OEmbed / ProviderException.php
1 <?php
2
3 namespace Drupal\media\OEmbed;
4
5 /**
6  * Exception thrown if an oEmbed provider causes an error.
7  *
8  * @internal
9  *   This is an internal part of the oEmbed system and should only be used by
10  *   oEmbed-related code in Drupal core.
11  */
12 class ProviderException extends \Exception {
13
14   /**
15    * Information about the oEmbed provider which caused the exception.
16    *
17    * @var \Drupal\media\OEmbed\Provider
18    *
19    * @see \Drupal\media\OEmbed\ProviderRepositoryInterface::get()
20    */
21   protected $provider;
22
23   /**
24    * ProviderException constructor.
25    *
26    * @param string $message
27    *   The exception message. '@name' will be replaced with the provider name
28    *   if available, or '<unknown>' if not.
29    * @param \Drupal\media\OEmbed\Provider $provider
30    *   (optional) The provider information.
31    * @param \Exception $previous
32    *   (optional) The previous exception, if any.
33    */
34   public function __construct($message, Provider $provider = NULL, \Exception $previous = NULL) {
35     $this->provider = $provider;
36     $message = str_replace('@name', $provider ? $provider->getName() : '<unknown>', $message);
37     parent::__construct($message, 0, $previous);
38   }
39
40 }