OEmbedResourceConstraintValidator
class OEmbedResourceConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface (View source)
| internal | This is an internal part of the oEmbed system and should only be used by oEmbed-related code in Drupal core. |
Validates oEmbed resource URLs.
Properties
| protected UrlResolverInterface | $urlResolver | The oEmbed URL resolver service. |
|
| protected ResourceFetcherInterface | $resourceFetcher | The resource fetcher service. |
|
| protected LoggerChannelInterface | $logger | The logger service. |
Methods
Constructs a new OEmbedResourceConstraintValidator.
Instantiates a new instance of this class.
{@inheritdoc}
Handles exceptions that occur during validation.
Details
__construct(UrlResolverInterface $url_resolver, ResourceFetcherInterface $resource_fetcher, LoggerChannelFactoryInterface $logger_factory)
Constructs a new OEmbedResourceConstraintValidator.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
validate($value, Constraint $constraint)
{@inheritdoc}
protected
handleException(Exception $e, string $error_message = NULL)
Handles exceptions that occur during validation.