From d2770ae258ed30e145e24babf7f562647b40f207 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 08:12:30 +0200 Subject: [PATCH 1/2] chore: Add return types of storage wrapper Signed-off-by: Julius Knorr --- lib/ACL/ACLStorageWrapper.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/ACL/ACLStorageWrapper.php b/lib/ACL/ACLStorageWrapper.php index d3096b2c7..f6a7625c9 100644 --- a/lib/ACL/ACLStorageWrapper.php +++ b/lib/ACL/ACLStorageWrapper.php @@ -10,10 +10,10 @@ namespace OCA\Collectives\ACL; use OC\Files\Cache\Cache; -use OC\Files\Cache\Scanner; use OC\Files\Cache\Wrapper\CacheWrapper; use OC\Files\Storage\Wrapper\Wrapper; use OCP\Constants; +use OCP\Files\Cache\IScanner; use Traversable; class ACLStorageWrapper extends Wrapper { @@ -60,7 +60,7 @@ public function isSharable($path): bool { return $this->checkPermissions(Constants::PERMISSION_SHARE) && parent::isSharable($path); } - public function getPermissions($path) { + public function getPermissions($path): int { return $this->storage->getPermissions($path) & $this->permissions; } @@ -110,7 +110,7 @@ public function unlink($path): bool { return $this->checkPermissions(Constants::PERMISSION_DELETE) && parent::unlink($path); } - public function file_put_contents($path, $data) { + public function file_put_contents($path, $data): int|float|false { $permissions = $this->file_exists($path) ? Constants::PERMISSION_UPDATE : Constants::PERMISSION_CREATE; return $this->checkPermissions($permissions) ? parent::file_put_contents($path, $data) : false; } @@ -147,7 +147,7 @@ public function getMetaData($path): ?array { return $data; } - public function getScanner($path = '', $storage = null): Scanner { + public function getScanner($path = '', $storage = null): IScanner { if (!$storage) { $storage = $this->storage; } @@ -164,14 +164,14 @@ public function is_file($path): bool { parent::is_file($path); } - public function stat($path) { + public function stat($path): array|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::stat($path); } - public function filetype($path) { + public function filetype($path): string|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } @@ -182,42 +182,42 @@ public function file_exists($path): bool { return $this->checkPermissions(Constants::PERMISSION_READ) && parent::file_exists($path); } - public function filemtime($path) { + public function filemtime($path): int|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::filemtime($path); } - public function file_get_contents($path) { + public function file_get_contents($path): string|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::file_get_contents($path); } - public function getMimeType($path) { + public function getMimeType($path): string|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::getMimeType($path); } - public function hash($type, $path, $raw = false) { + public function hash($type, $path, $raw = false): string|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::hash($type, $path, $raw); } - public function getETag($path) { + public function getETag($path): string|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } return parent::getETag($path); } - public function getDirectDownload($path) { + public function getDirectDownload($path): array|false { if (!$this->checkPermissions(Constants::PERMISSION_READ)) { return false; } From df190af3720be2073aaa80a5868a853733dbf3ba Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 17:03:22 +0200 Subject: [PATCH 2/2] ci: Drop conflicting dev dependencies for behat Signed-off-by: Julius Knorr --- .github/workflows/behat-sqlite-encryption.yml | 5 ++++- .github/workflows/behat-sqlite.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/behat-sqlite-encryption.yml b/.github/workflows/behat-sqlite-encryption.yml index 227b98ca1..ce6663983 100644 --- a/.github/workflows/behat-sqlite-encryption.yml +++ b/.github/workflows/behat-sqlite-encryption.yml @@ -90,7 +90,10 @@ jobs: - name: Install composer dependencies working-directory: apps/${{ env.APP_NAME }} - run: composer i + run: | + composer i + # remove as those dev dependencies pull in an outdated psr/log + composer remove --dev nextcloud/ocp - name: Set up Nextcloud env: diff --git a/.github/workflows/behat-sqlite.yml b/.github/workflows/behat-sqlite.yml index c96e539fd..25a82fe34 100644 --- a/.github/workflows/behat-sqlite.yml +++ b/.github/workflows/behat-sqlite.yml @@ -93,7 +93,10 @@ jobs: - name: Install composer dependencies working-directory: apps/${{ env.APP_NAME }} - run: composer i + run: | + composer i + # remove as those dev dependencies pull in an outdated psr/log + composer remove --dev nextcloud/ocp - name: Set up Nextcloud env: