From 50e221be9ef91adeeadb7cdbe5dc8d26c6e188b4 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 08:12:30 +0200 Subject: [PATCH 1/3] 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 23151e01aab517b3f277ba5e892f35ca692ce821 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 08:44:58 +0200 Subject: [PATCH 2/3] tmp: print logs Signed-off-by: Julius Knorr --- .github/workflows/behat-sqlite.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/behat-sqlite.yml b/.github/workflows/behat-sqlite.yml index c96e539fd..e2a9de060 100644 --- a/.github/workflows/behat-sqlite.yml +++ b/.github/workflows/behat-sqlite.yml @@ -116,7 +116,9 @@ jobs: - name: Behat integration working-directory: apps/${{ env.APP_NAME }} - run: ./vendor/bin/behat --config=${{ env.BEHAT_CONFIG }} --profile ci + run: | + tail -f ../../data/nextcloud.log & + ./vendor/bin/behat --config=${{ env.BEHAT_CONFIG }} --profile ci summary: permissions: From a60e676e8b8e3ff9c4f9aa0e8137bb9b03bd5ed4 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 17:03:22 +0200 Subject: [PATCH 3/3] ci: Drop conflicting dev dependencies for behat Signed-off-by: Julius Knorr --- .github/workflows/behat-sqlite.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/behat-sqlite.yml b/.github/workflows/behat-sqlite.yml index e2a9de060..67c47da37 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: