Skip to content

Commit edeed9c

Browse files
authored
Merge pull request #1743 from nextcloud/carl/perf-getbyid
perf: Replace getById call with getFistNodeByid
2 parents bce20b1 + d24f3a6 commit edeed9c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ The Notes app is a distraction free notes taking app for [Nextcloud](https://www
2525
<repository type="git">https://github.com/nextcloud/notes.git</repository>
2626
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes-thumbnail.jpg">https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes.png</screenshot>
2727
<dependencies>
28-
<php min-version="8.0" max-version="8.4"/>
29-
<nextcloud min-version="28" max-version="34"/>
28+
<php min-version="8.1" max-version="8.4"/>
29+
<nextcloud min-version="30" max-version="34"/>
3030
</dependencies>
3131
<repair-steps>
3232
<post-migration>

lib/Service/NotesService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@ private function getCustomExtension(string $userId) {
290290
* @throws NoteDoesNotExistException
291291
*/
292292
private static function getFileById(string $customExtension, Folder $folder, int $id) : File {
293-
$file = $folder->getById($id);
293+
$file = $folder->getFirstNodeById($id);
294294

295-
if (!array_key_exists(0, $file) || !($file[0] instanceof File) || !self::isNote($file[0], $customExtension)) {
295+
if (!($file instanceof File) || !self::isNote($file, $customExtension)) {
296296
throw new NoteDoesNotExistException();
297297
}
298-
return $file[0];
298+
return $file;
299299
}
300300

301301
/**

psalm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
77
errorBaseline="tests/psalm-baseline.xml"
8-
phpVersion="8.0"
8+
phpVersion="8.1"
99
>
1010
<stubs>
1111
<file name="tests/stubs/ocp.php" preloadClasses="true"/>

0 commit comments

Comments
 (0)