Skip to content

Commit

Permalink
ignore call to getstorageinfo in psalm
Browse files Browse the repository at this point in the history
Signed-off-by: grnd-alt <[email protected]>
  • Loading branch information
grnd-alt committed Apr 4, 2024
1 parent 1fe1a26 commit e148e9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,17 +487,16 @@ public function putFile($fileId,

// Get expected FileSize after writing
$storage = \OC_Helper::getStorageInfo($path);
fseek($content,0,SEEK_END);
fseek($content, 0, SEEK_END);
$finalSize = ftell($content) + $file->getSize();
rewind( $content );
rewind($content);

try {
if ($finalSize <= $storage['free']){
if ($finalSize <= $storage['free']) {
$this->wrappedFilesystemOperation($wopi, function () use ($file, $content) {
return $file->putContent($content);
});
}
else {
} else {
throw new \Exception('Not enough storage');
}
} catch (LockedException $e) {
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
</ignoreFiles>
</extraFiles>
<issueHandlers>
<UndefinedMethod>
<errorLevel type="suppress">
<referencedMethod name="OC_Helper::getstorageinfo" />
</errorLevel>
</UndefinedMethod>
<UndefinedMagicMethod>
<errorLevel type="suppress">
<referencedMethod name="/Db\\.*::.*/" />
Expand Down

0 comments on commit e148e9b

Please sign in to comment.