You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
468 B

<?php
declare(strict_types = 1);
namespace Movim;
use Embed\Detectors\Detector;
class EmbedImagesExtractor extends Detector
{
public function detect(): array
{
$document = $this->extractor->getDocument();
$images = [];
foreach ($document->select('.//img')->nodes() as $node) {
$src = $node->getAttribute('src');
$images[$src] = $this->extractor->resolveUri($src);
}
return $images;
}
}