Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Jul 16, 2024
2 parents 5c406a0 + 01da961 commit 0e2c4a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

use Rector\Config\RectorConfig;
use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
Expand All @@ -40,7 +39,6 @@
$rectorConfig->importShortClasses(false);
$rectorConfig->skip([
ExceptionHandlerTypehintRector::class,
AddSeeTestAnnotationRector::class,
PreferPHPUnitThisCallRector::class,
]);
};
6 changes: 2 additions & 4 deletions src/Provider/YouTubeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,11 @@ private function fixBinaryContent(MediaInterface $media): void
return;
}

$isMatching = preg_match(
if (1 === preg_match(
'{^(?:https?://)?(?:www\.)?(?:m\.)?(?:youtu\.be/|youtube\.com/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)/))(?<video_id>[^\#\?&\'>]+)}',
$media->getBinaryContent(),
$matches
);

if (false !== $isMatching) {
)) {
$media->setBinaryContent($matches['video_id']);
}
}
Expand Down

0 comments on commit 0e2c4a9

Please sign in to comment.