Framework Update
This commit is contained in:
+10
-14
@@ -1,12 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Respect/Validation.
|
||||
*
|
||||
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE file
|
||||
* that was distributed with this source code.
|
||||
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
@@ -31,19 +27,19 @@ use function sprintf;
|
||||
*/
|
||||
final class VideoUrl extends AbstractRule
|
||||
{
|
||||
private const SERVICES = [
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
'youtube' => '@^https?://(www\.)?(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^\"&?/]{11})@i',
|
||||
'vimeo' => '@^https?://(www\.)?(player\.)?(vimeo\.com/)((channels/[A-z]+/)|(groups/[A-z]+/videos/)|(video/))?([0-9]+)@i',
|
||||
'twitch' => '@^https?://(((www\.)?twitch\.tv/videos/[0-9]+)|clips\.twitch\.tv/[a-zA-Z]+)$@i',
|
||||
// phpcs:enable Generic.Files.LineLength.TooLong
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $service;
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
private const SERVICES = [
|
||||
'youtube' => '@^https?://(www\.)?(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^\"&?/]{11})@i',
|
||||
'vimeo' => '@^https?://(www\.)?(player\.)?(vimeo\.com/)((channels/[A-z]+/)|(groups/[A-z]+/videos/)|(video/))?([0-9]+)@i',
|
||||
'twitch' => '@^https?://(((www\.)?twitch\.tv/videos/[0-9]+)|clips\.twitch\.tv/[a-zA-Z]+)$@i',
|
||||
];
|
||||
// phpcs:enable Generic.Files.LineLength.TooLong
|
||||
|
||||
/**
|
||||
* Create a new instance VideoUrl.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user