mirror of https://github.com/nextcloud/bookmarks
parent
bda7588a50
commit
8ceba5a50c
|
@ -98,7 +98,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['bookmark']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'bookmark_deleted':
|
||||
if ($isAuthor) {
|
||||
$event->setParsedSubject($this->l->t('You deleted "%s"', [
|
||||
|
@ -114,7 +114,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['bookmark']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'folder_created':
|
||||
if ($isAuthor) {
|
||||
$event->setParsedSubject($this->l->t('You created folder "%s"', [
|
||||
|
@ -130,7 +130,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['folder']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'folder_moved':
|
||||
if ($isAuthor) {
|
||||
$event->setParsedSubject($this->l->t('You moved folder "%s"', [
|
||||
|
@ -146,7 +146,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['folder']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'folder_deleted':
|
||||
if ($isAuthor) {
|
||||
$event->setParsedSubject($this->l->t('You deleted folder "%s"', [
|
||||
|
@ -162,7 +162,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['folder']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'share_created':
|
||||
if ($isAuthor && $shareeName !== null) {
|
||||
$event->setParsedSubject($this->l->t('You shared folder "%1$s" with %2$s', [
|
||||
|
@ -183,7 +183,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['folder']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'share_deleted':
|
||||
if ($isAuthor && $shareeName) {
|
||||
$event->setParsedSubject($this->l->t('You unshared folder "%1$s" with %2$s', [
|
||||
|
@ -204,7 +204,7 @@ class Provider implements IProvider {
|
|||
$subjectParameters['folder']
|
||||
]));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw new InvalidArgumentException();
|
||||
}
|
||||
|
|
|
@ -520,9 +520,9 @@ class TreeMapper extends QBMapper {
|
|||
$this->addToFolders($type, $itemId, $folders);
|
||||
$this->removeFromFolders($type, $itemId, array_map(static function (Folder $f) {
|
||||
return $f->getId();
|
||||
}, array_filter($currentFolders, static function (Folder $folder) use ($folders) {
|
||||
return !in_array($folder->getId(), $folders, true);
|
||||
})));
|
||||
}, array_filter($currentFolders, static function (Folder $folder) use ($folders) {
|
||||
return !in_array($folder->getId(), $folders, true);
|
||||
})));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -107,9 +107,9 @@ class GroupSharesUpdateRepairStep implements IRepairStep {
|
|||
}
|
||||
$usersInGroup = array_filter(array_map(static function ($user) {
|
||||
return $user->getUID();
|
||||
}, $group->getUsers()), static function ($userId) use ($groupShare) {
|
||||
return $userId !== $groupShare['owner'];
|
||||
});
|
||||
}, $group->getUsers()), static function ($userId) use ($groupShare) {
|
||||
return $userId !== $groupShare['owner'];
|
||||
});
|
||||
|
||||
$notInShareUsers = array_diff($usersInGroup, $usersInShare);
|
||||
$notInGroupUsers = array_diff($usersInShare, $usersInGroup);
|
||||
|
|
|
@ -325,9 +325,9 @@ class BookmarkService {
|
|||
if ($bookmark->getUserId() !== $userId) {
|
||||
$currentInaccessibleOwnFolders = array_map(static function ($f) {
|
||||
return $f->getId();
|
||||
}, array_filter($currentOwnFolders, function ($folder) use ($userId) {
|
||||
return $this->folders->findShareByDescendantAndUser($folder, $userId) === null;
|
||||
})
|
||||
}, array_filter($currentOwnFolders, function ($folder) use ($userId) {
|
||||
return $this->folders->findShareByDescendantAndUser($folder, $userId) === null;
|
||||
})
|
||||
);
|
||||
} else {
|
||||
$currentInaccessibleOwnFolders = [];
|
||||
|
|
|
@ -153,7 +153,7 @@ class BookmarksParser {
|
|||
if (count($this->folderDepth) > 1) {
|
||||
$this->closeFolder();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'a':
|
||||
$this->addBookmark($entry);
|
||||
break;
|
||||
|
@ -162,7 +162,7 @@ class BookmarksParser {
|
|||
if ($entry->hasChildNodes()) {
|
||||
$this->traverse($entry);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'h3':
|
||||
$this->addFolder($entry);
|
||||
break;
|
||||
|
|
|
@ -182,12 +182,12 @@ class BackgroundJobTest extends TestCase {
|
|||
public function singleBookmarksProvider() {
|
||||
return array_map(function ($props) {
|
||||
return Bookmark::fromArray($props);
|
||||
}, [
|
||||
'Simple URL with title and description' => ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
'Simple URL with title' => ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
'Simple URL' => ['url' => 'https://php.net/'],
|
||||
'URL with unicode' => ['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
'Non-existent URL' => ['url' => 'https://http://www.bllaala.com/'],
|
||||
]);
|
||||
}, [
|
||||
'Simple URL with title and description' => ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
'Simple URL with title' => ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
'Simple URL' => ['url' => 'https://php.net/'],
|
||||
'URL with unicode' => ['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
'Non-existent URL' => ['url' => 'https://http://www.bllaala.com/'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,11 +133,11 @@ class BookmarkMapperTest extends TestCase {
|
|||
public function singleBookmarksProvider(): array {
|
||||
return array_map(static function ($props) {
|
||||
return [Db\Bookmark::fromArray($props)];
|
||||
}, [
|
||||
'Simple URL with title and description' => ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
'Simple URL with title' => ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
'Simple URL' => ['url' => 'https://php.net/'],
|
||||
'URL with unicode' => ['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
]);
|
||||
}, [
|
||||
'Simple URL with title and description' => ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
'Simple URL with title' => ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
'Simple URL' => ['url' => 'https://php.net/'],
|
||||
'URL with unicode' => ['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,11 +119,11 @@ class FindTest extends TestCase {
|
|||
public function singleBookmarksProvider() {
|
||||
return array_map(function ($data) {
|
||||
return [$data[0], Db\Bookmark::fromArray($data[1])];
|
||||
}, [
|
||||
[['one'], ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine']],
|
||||
[['two'], ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud']],
|
||||
[['three', 'one'], ['url' => 'https://php.net/']],
|
||||
[['two', 'four', 'one'], ['url' => 'https://de.wikipedia.org/wiki/%C3%9C']],
|
||||
]);
|
||||
}, [
|
||||
[['one'], ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine']],
|
||||
[['two'], ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud']],
|
||||
[['three', 'one'], ['url' => 'https://php.net/']],
|
||||
[['two', 'four', 'one'], ['url' => 'https://de.wikipedia.org/wiki/%C3%9C']],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,13 +165,13 @@ class HtmlImportExportTest extends TestCase {
|
|||
return [
|
||||
array_map(function ($props) {
|
||||
return Db\Bookmark::fromArray($props);
|
||||
}, [
|
||||
['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
['url' => 'https://php.net/'],
|
||||
['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
['url' => 'https://github.com/nextcloud/bookmarks/projects/1'],
|
||||
]),
|
||||
}, [
|
||||
['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine'],
|
||||
['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
|
||||
['url' => 'https://php.net/'],
|
||||
['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
|
||||
['url' => 'https://github.com/nextcloud/bookmarks/projects/1'],
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,11 +170,11 @@ class TagMapperTest extends TestCase {
|
|||
public function singleBookmarksProvider() {
|
||||
return array_map(function ($data) {
|
||||
return [$data[0], Db\Bookmark::fromArray($data[1])];
|
||||
}, [
|
||||
[['one'], ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine']],
|
||||
[['two'], ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud']],
|
||||
[['three', 'one'], ['url' => 'https://php.net/']],
|
||||
[['two', 'four', 'one'], ['url' => 'https://de.wikipedia.org/wiki/%C3%9C']],
|
||||
]);
|
||||
}, [
|
||||
[['one'], ['url' => 'https://google.com/', 'title' => 'Google', 'description' => 'Search engine']],
|
||||
[['two'], ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud']],
|
||||
[['three', 'one'], ['url' => 'https://php.net/']],
|
||||
[['two', 'four', 'one'], ['url' => 'https://de.wikipedia.org/wiki/%C3%9C']],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue