/**
* @return array
*/
public function findFiles()
{
$files = array();
$finder = new Finder();
$iterate = false;
$finder->ignoreUnreadableDirs();
foreach ($this->items as $item) {
if (!is_file($item)) {
$finder->in($item);
$iterate = true;
} else {
$files[] = realpath($item);
}
}
foreach ($this->excludes as $exclude) {
$finder->exclude($exclude);
}
foreach ($this->names as $name) {
$finder->name($name);
}
foreach ($this->notNames as $notName) {
$finder->notName($notName);
}
foreach ($this->regularExpressionsExcludes as $regularExpressionExclude) {
$finder->notPath($regularExpressionExclude);
}
if ($iterate) {
foreach ($finder as $file) {
$files[] = $file->getRealpath();
}
}
return $files;
}