Skip to content

Commit

Permalink
🩹 (#2719): fix interface typing
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
  • Loading branch information
Vinicius Reis committed Jul 18, 2022
1 parent f8b1225 commit bf46037
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions lib/TextFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,24 @@ public function __construct(ISimpleFile $file, EncodingService $encodingService)
$this->encodingService = $encodingService;
}

public function getName() {
public function getName(): string {
return $this->file->getName();
}

public function getSize() {
public function getSize(): int {
return $this->file->getSize();
}

public function getETag() {
public function getETag(): string {
return $this->file->getETag();
}

public function getMTime() {
public function getMTime(): int
{
return $this->file->getMTime();
}

public function getContent() {
public function getContent(): string {
$content = $this->encodingService->encodeToUtf8($this->file->getContent());
if ($content === null) {
throw new NotFoundException('File not compatible with text because it could not be encoded to UTF-8.');
Expand All @@ -67,15 +68,15 @@ public function getContent() {
return $content;
}

public function putContent($data) {
return $this->file->putContent($data);
public function putContent($data): void {
$this->file->putContent($data);
}

public function delete() {
public function delete(): void {
$this->file->delete();
}

public function getMimeType() {
public function getMimeType(): string {
return 'text/plain;encoding=utf-8';
}

Expand All @@ -87,7 +88,7 @@ public function read() {
return $this->file->read();
}

public function write() {
public function write(): bool {
return $this->file->write();
}
}

0 comments on commit bf46037

Please sign in to comment.