Code Duplication    Length = 14-14 lines in 2 locations

lib/private/Files/SimpleFS/SimpleFolder.php 1 location

@@ 49-62 (lines=14) @@
46
		return $this->folder->getName();
47
	}
48
49
	public function getDirectoryListing() {
50
		$listing = $this->folder->getDirectoryListing();
51
52
		$fileListing = array_map(function(Node $file) {
53
			if ($file instanceof File) {
54
				return new SimpleFile($file);
55
			}
56
			return null;
57
		}, $listing);
58
59
		$fileListing = array_filter($fileListing);
60
61
		return array_values($fileListing);
62
	}
63
64
	public function delete() {
65
		$this->folder->delete();

lib/private/Files/AppData/AppData.php 1 location

@@ 119-132 (lines=14) @@
116
		return new SimpleFolder($folder);
117
	}
118
119
	public function getDirectoryListing(): array {
120
		$listing = $this->getAppDataFolder()->getDirectoryListing();
121
122
		$fileListing = array_map(function(Node $folder) {
123
			if ($folder instanceof Folder) {
124
				return new SimpleFolder($folder);
125
			}
126
			return null;
127
		}, $listing);
128
129
		$fileListing = array_filter($fileListing);
130
131
		return array_values($fileListing);
132
	}
133
134
	public function getId(): int {
135
		return $this->getAppDataFolder()->getId();