Skip to content
Snippets Groups Projects
Select Git revision
  • b99f81edd9c6dac739f149036fe3ec6306877694
  • develop default protected
  • 1.3 protected
  • 1.1
  • 1.2 protected
  • 1.0
  • 13-export-cli-command
  • 1.7.0
  • 1.6.0
  • 1.5.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
  • 1.4.0
  • 1.3.7
  • 1.3.6
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.1.4
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.0.6
27 results

MediaDirectiveFileParser.php

Blame
  • MediaDirectiveFileParser.php 585 B
    <?php
    declare(strict_types=1);
    
    namespace Firegento\ContentProvisioning\Model\Config\Parser\Query\Media;
    
    use Firegento\ContentProvisioning\Api\MediaFilesParserInterface;
    
    class MediaDirectiveFileParser implements MediaFilesParserInterface
    {
        /**
         * Parse media files from {media} directives
         *
         * @param string $content
         * @return array
         */
        public function execute(string $content): array
        {
            if (preg_match_all('/\{\{media url=(?P<path>.*?)\}\}/', $content, $matches)) {
                return $matches['path'];
            }
    
            return [];
        }
    }