updated-packages
This commit is contained in:
@@ -21,21 +21,21 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
||||
abstract class AbstractFileExtractor
|
||||
{
|
||||
/**
|
||||
* @param string|array $resource Files, a file or a directory
|
||||
* @param string|iterable $resource Files, a file or a directory
|
||||
*
|
||||
* @return array
|
||||
* @return iterable
|
||||
*/
|
||||
protected function extractFiles($resource)
|
||||
{
|
||||
if (\is_array($resource) || $resource instanceof \Traversable) {
|
||||
$files = array();
|
||||
if (is_iterable($resource)) {
|
||||
$files = [];
|
||||
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();
|
||||
$files = $this->canBeExtracted($resource) ? [$this->toSplFileInfo($resource)] : [];
|
||||
} else {
|
||||
$files = $this->extractFromDirectory($resource);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ abstract class AbstractFileExtractor
|
||||
/**
|
||||
* @param string|array $resource Files, a file or a directory
|
||||
*
|
||||
* @return array files to be extracted
|
||||
* @return iterable files to be extracted
|
||||
*/
|
||||
abstract protected function extractFromDirectory($resource);
|
||||
}
|
||||
|
Reference in New Issue
Block a user