trashManager->listTrashFolder($this->data); $children = array_map(function (ITrashItem $entry) { if ($entry->getType() === FileInfo::TYPE_FOLDER) { return new TrashFolderFolder($this->trashManager, $entry); } return new TrashFolderFile($this->trashManager, $entry); }, $entries); return $children; } public function getChild($name): ITrash { $entries = $this->getChildren(); foreach ($entries as $entry) { if ($entry->getName() === $name) { return $entry; } } throw new NotFound(); } public function childExists($name): bool { try { $this->getChild($name); return true; } catch (NotFound $e) { return false; } } public function setName($name) { throw new Forbidden(); } public function createFile($name, $data = null) { throw new Forbidden(); } public function createDirectory($name) { throw new Forbidden(); } }