You are here

protected function AbstractFileExtractor::extractFiles in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Extractor/AbstractFileExtractor.php \Symfony\Component\Translation\Extractor\AbstractFileExtractor::extractFiles()

Parameters

string|array $resource files, a file or a directory:

Return value

array

File

vendor/symfony/translation/Extractor/AbstractFileExtractor.php, line 26

Class

AbstractFileExtractor
Base class used by classes that extract translation messages from files.

Namespace

Symfony\Component\Translation\Extractor

Code

protected function extractFiles($resource) {
  if (is_array($resource) || $resource instanceof \Traversable) {
    $files = array();
    foreach ($resource as $file) {
      if ($this
        ->canBeExtracted($file)) {
        $files[] = $this
          ->toSplFileInfo($file);
      }
    }
  }
  elseif (is_file($resource)) {
    $files = $this
      ->canBeExtracted($resource) ? array(
      $this
        ->toSplFileInfo($resource),
    ) : array();
  }
  else {
    $files = $this
      ->extractFromDirectory($resource);
  }
  return $files;
}