Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / media / src / Plugin / Validation / Constraint / OEmbedResourceConstraint.php
1 <?php
2
3 namespace Drupal\media\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraint;
6
7 /**
8  * Checks if a value represents a valid oEmbed resource URL.
9  *
10  * @internal
11  *   This is an internal part of the oEmbed system and should only be used by
12  *   oEmbed-related code in Drupal core.
13  *
14  * @Constraint(
15  *   id = "oembed_resource",
16  *   label = @Translation("oEmbed resource", context = "Validation"),
17  *   type = {"link", "string", "string_long"}
18  * )
19  */
20 class OEmbedResourceConstraint extends Constraint {
21
22   /**
23    * The error message if the URL does not match any known provider.
24    *
25    * @var string
26    */
27   public $unknownProviderMessage = 'The given URL does not match any known oEmbed providers.';
28
29   /**
30    * The error message if the URL matches a disallowed provider.
31    *
32    * @var string
33    */
34   public $disallowedProviderMessage = 'Sorry, the @name provider is not allowed.';
35
36   /**
37    * The error message if the URL is not a valid oEmbed resource.
38    *
39    * @var string
40    */
41   public $invalidResourceMessage = 'The provided URL does not represent a valid oEmbed resource.';
42
43   /**
44    * The error message if an unexpected behavior occurs.
45    *
46    * @var string
47    */
48   public $providerErrorMessage = 'An error occurred while trying to retrieve the oEmbed provider database.';
49
50 }