Skip to content

Commit 75e6b3e

Browse files
committed
refactor(node): Be more exact about the types returned
Signed-off-by: Carl Schwan <[email protected]>
1 parent d5c729b commit 75e6b3e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/private/Files/Node/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class File extends Node implements \OCP\Files\File {
1616
#[Override]
17-
protected function createNonExistingNode(string $path): \OCP\Files\Node {
17+
protected function createNonExistingNode(string $path): NonExistingFile {
1818
return new NonExistingFile($this->root, $this->view, $path);
1919
}
2020

lib/private/Files/Node/Folder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Folder extends Node implements \OCP\Files\Folder {
3737
private bool $wasDeleted = false;
3838

3939
#[Override]
40-
protected function createNonExistingNode(string $path): INode {
40+
protected function createNonExistingNode(string $path): NonExistingFolder {
4141
return new NonExistingFolder($this->root, $this->view, $path);
4242
}
4343

@@ -101,7 +101,7 @@ public function nodeExists(string $path): bool {
101101
}
102102

103103
#[Override]
104-
public function newFolder(string $path): \OCP\Files\Folder {
104+
public function newFolder(string $path): self {
105105
if ($this->checkPermissions(Constants::PERMISSION_CREATE)) {
106106
$fullPath = $this->getFullPath($path);
107107
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
@@ -132,7 +132,7 @@ public function newFolder(string $path): \OCP\Files\Folder {
132132
}
133133

134134
#[Override]
135-
public function newFile(string $path, $content = null): \OCP\Files\File {
135+
public function newFile(string $path, $content = null): File {
136136
if ($path === '') {
137137
throw new NotPermittedException('Could not create as provided path is empty');
138138
}

lib/private/Files/Node/NonExistingFolder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ public function nodeExists(string $path): bool {
142142
}
143143

144144
#[Override]
145-
public function newFolder(string $path): \OCP\Files\Folder {
145+
public function newFolder(string $path): Folder {
146146
throw new NotFoundException();
147147
}
148148

149149
#[Override]
150-
public function newFile(string $path, $content = null): \OCP\Files\File {
150+
public function newFile(string $path, $content = null): File {
151151
throw new NotFoundException();
152152
}
153153

0 commit comments

Comments
 (0)