fixed more indentations
This commit is contained in:
parent
acf8990de1
commit
f031591753
9 changed files with 148 additions and 148 deletions
|
@ -3,34 +3,34 @@
|
|||
namespace OCA\GroupfolderFilesystemSnapshots\Helpers;
|
||||
|
||||
class FileHelper {
|
||||
private static function seperateFilesFromFolders($parentDir, $items) {
|
||||
$files = [];
|
||||
$folders = [];
|
||||
private static function seperateFilesFromFolders($parentDir, $items) {
|
||||
$files = [];
|
||||
$folders = [];
|
||||
|
||||
foreach($items as $item) {
|
||||
if(is_dir($parentDir . DIRECTORY_SEPARATOR . $item)) {
|
||||
$folders[] = $item;
|
||||
} else {
|
||||
$files[] = $item;
|
||||
}
|
||||
}
|
||||
foreach($items as $item) {
|
||||
if(is_dir($parentDir . DIRECTORY_SEPARATOR . $item)) {
|
||||
$folders[] = $item;
|
||||
} else {
|
||||
$files[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
return array($files, $folders);
|
||||
}
|
||||
return array($files, $folders);
|
||||
}
|
||||
|
||||
public static function getFilesAndFolders($dir) {
|
||||
$scan = array_diff(scandir($dir), array('..', '.'));
|
||||
public static function getFilesAndFolders($dir) {
|
||||
$scan = array_diff(scandir($dir), array('..', '.'));
|
||||
|
||||
return self::seperateFilesFromFolders($dir, $scan);
|
||||
}
|
||||
return self::seperateFilesFromFolders($dir, $scan);
|
||||
}
|
||||
|
||||
public static function getFilesizesOfFiles($prefix, array $files) {
|
||||
$result = array();
|
||||
public static function getFilesizesOfFiles($prefix, array $files) {
|
||||
$result = array();
|
||||
|
||||
foreach($files as $index=>$file) {
|
||||
$result[$index] = filesize($prefix . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
foreach($files as $index=>$file) {
|
||||
$result[$index] = filesize($prefix . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue