isFile()) { continue; } $filepath = $file->getPathname(); if (!in_array(pathinfo($filepath, PATHINFO_EXTENSION), $extensions)) { continue; } $files[] = $filepath; } return $files; }