Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix(external_storage): Cast id to int #49624

Open
wants to merge 1 commit into
base: stable30
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/files_external/lib/Service/StoragesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
* @return StorageConfig
* @throws NotFoundException if the storage with the given id was not found
*/
public function getStorage($id) {
public function getStorage(int $id) {
$mount = $this->dbConfig->getMountById($id);

if (!is_array($mount)) {
Expand Down Expand Up @@ -450,7 +450,7 @@
*
* @throws NotFoundException if no storage was found with the given id
*/
public function removeStorage($id) {
public function removeStorage(int $id) {
$existingMount = $this->dbConfig->getMountById($id);

if (!is_array($existingMount)) {
Expand All @@ -476,7 +476,7 @@
try {
$class = $storageConfig->getBackend()->getStorageClass();
/** @var \OC\Files\Storage\Storage $storage */
$storage = new $class($storageConfig->getBackendOptions());

Check notice

Code scanning / Psalm

MissingReturnType Note

Method OCA\Files_External\Service\StoragesService::removeStorage does not have a return type, expecting void

// auth mechanism should fire first
$storage = $storageConfig->getBackend()->wrapStorage($storage);
Expand Down
Loading