src/Viserio/Component/Translation/Extractor/AbstractFileExtractor.php
protected function extractFiles($resource): array
    {
        if (\is_array($resource) || $resource instanceof Traversable) {
            $files = [];

            foreach ($resource as $file) {
                if ($file instanceof SplFileInfo) {
                    $file = $file->getPathname();
                }

                if ($this->canBeExtracted($file)) {
                    $files[] = $file;
                }
            }
        } else {
            if ($resource instanceof SplFileInfo) {
                $resource = $resource->getPathname();
            }

            if (\is_file($resource)) {
                $files = $this->canBeExtracted($resource) ? [$resource] : [];
            } else {
                $files = $this->extractFromDirectory($resource);
            }
        }

        return $files;
    }
protected function extractFiles($resource): array
    {
        if (\is_array($resource) || $resource instanceof Traversable) {
            $files = [];

            foreach ($resource as $file) {
                if ($file instanceof SplFileInfo) {
                    $file = $file->getPathname();
                }

                if ($this->canBeExtracted($file)) {
                    $files[] = $file;
                }
            }
        } else {
            if ($resource instanceof SplFileInfo) {
                $resource = $resource->getPathname();
            }

            if (\is_file($resource)) {
                $files = $this->canBeExtracted($resource) ? [$resource] : [];
            } else {
                $files = $this->extractFromDirectory($resource);
            }
        }

        return $files;
    }
@param array|string $resource Files, a file or a directory

@return array