diff --git a/composer.json b/composer.json index 4e0fef42..6b59429c 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,19 @@ { "name": "nextcloud/guests", "config": { - "optimize-autoloader": true, - "classmap-authoritative": true, "platform": { - "php": "8.1.0" + "php": "8.1" + }, + "sort-packages": true, + "allow-plugins": { + "bamarni/composer-bin-plugin": true }, - "sort-packages": true + "optimize-autoloader": true, + "autoloader-suffix": "Guests" }, - "autoload-dev": { + "autoload": { "psr-4": { - "OCP\\": "vendor/nextcloud/ocp/OCP" + "OCA\\Guests\\": "lib/" } }, "scripts": { @@ -20,14 +23,17 @@ "psalm": "psalm --threads=1", "psalm:update-baseline": "psalm --threads=1 --update-baseline", "psalm:clear": "psalm --clear-cache && psalm --clear-global-cache", - "psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType", + "psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType", "test:unit": "vendor/bin/phpunit -c phpunit.xml" }, + "require": { + "php": ">=8.1 <=8.4" + }, "require-dev": { "nextcloud/coding-standard": "^1.3.2", - "nextcloud/ocp": "dev-master", + "nextcloud/ocp": "dev-stable30", "php-parallel-lint/php-parallel-lint": "^1.2", "phpunit/phpunit": "^9", - "vimeo/psalm": "^5.14" + "vimeo/psalm": "^5.26.1" } } diff --git a/composer.lock b/composer.lock index 86af6a6b..fc1743b6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a7ef257fb6ccbd737c944799d0740280", + "content-hash": "e07f01cc499f035d121ce1707c77c474", "packages": [], "packages-dev": [ { @@ -432,26 +432,29 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -471,9 +474,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "doctrine/instantiator", @@ -709,26 +712,26 @@ }, { "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.22.0", + "version": "v3.32.0", "source": { "type": "git", "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + "reference": "c3a815a496f5cd6356726902f421013cbb7ba3f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/c3a815a496f5cd6356726902f421013cbb7ba3f3", + "reference": "c3a815a496f5cd6356726902f421013cbb7ba3f3", "shasum": "" }, "require": { "ext-filter": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.61.1", + "friendsofphp/php-cs-fixer": "^3.85", "php": "^7.4 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.6.4 || ^10.5.29" + "phpunit/phpunit": "^9.6.22 || 10.5.45 || ^11.5.7" }, "type": "library", "autoload": { @@ -749,22 +752,28 @@ "description": "A set of custom fixers for PHP CS Fixer", "support": { "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", - "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.32.0" }, - "time": "2024-08-16T20:44:35+00:00" + "funding": [ + { + "url": "https://github.com/kubawerlos", + "type": "github" + } + ], + "time": "2025-08-01T06:10:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -803,7 +812,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -811,7 +820,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "netresearch/jsonmapper", @@ -866,21 +875,21 @@ }, { "name": "nextcloud/coding-standard", - "version": "v1.3.2", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" + "reference": "8e06808c1423e9208d63d1bd205b9a38bd400011" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/8e06808c1423e9208d63d1bd205b9a38bd400011", + "reference": "8e06808c1423e9208d63d1bd205b9a38bd400011", "shasum": "" }, "require": { "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", - "php": "^7.3|^8.0", + "php": "^8.0", "php-cs-fixer/shim": "^3.17" }, "type": "library", @@ -900,38 +909,40 @@ } ], "description": "Nextcloud coding standards for the php cs fixer", + "keywords": [ + "dev" + ], "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.4.0" }, - "time": "2024-10-14T16:49:05+00:00" + "time": "2025-06-19T12:27:27+00:00" }, { "name": "nextcloud/ocp", - "version": "dev-master", + "version": "dev-stable30", "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "6e597101481226c5d2518d98596301f2efc692d1" + "reference": "10759bbd889e38ef5d6785737db9fb119880a194" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/6e597101481226c5d2518d98596301f2efc692d1", - "reference": "6e597101481226c5d2518d98596301f2efc692d1", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/10759bbd889e38ef5d6785737db9fb119880a194", + "reference": "10759bbd889e38ef5d6785737db9fb119880a194", "shasum": "" }, "require": { - "php": "~8.1 || ~8.2 || ~8.3 || ~8.4", + "php": "~8.0 || ~8.1 || ~8.2 || ~8.3", "psr/clock": "^1.0", "psr/container": "^2.0.2", "psr/event-dispatcher": "^1.0", - "psr/log": "^3.0.2" + "psr/log": "^2.0.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "32.0.0-dev" + "dev-stable30": "30.0.0-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -942,18 +953,14 @@ { "name": "Christoph Wurst", "email": "christoph@winzerhof-wurst.at" - }, - { - "name": "Joas Schilling", - "email": "coding@schilljs.com" } ], - "description": "Composer package containing Nextcloud's public OCP API and the unstable NCU API", + "description": "Composer package containing Nextcloud's public API (classes, interfaces)", "support": { "issues": "https://github.com/nextcloud-deps/ocp/issues", - "source": "https://github.com/nextcloud-deps/ocp/tree/master" + "source": "https://github.com/nextcloud-deps/ocp/tree/stable30" }, - "time": "2025-02-14T00:43:30+00:00" + "time": "2025-07-04T00:53:40+00:00" }, { "name": "nikic/php-parser", @@ -1131,16 +1138,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.68.5", + "version": "v3.85.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c" + "reference": "00a3dad9505df669736aaa8c017e6cc74e46075a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", - "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/00a3dad9505df669736aaa8c017e6cc74e46075a", + "reference": "00a3dad9505df669736aaa8c017e6cc74e46075a", "shasum": "" }, "require": { @@ -1177,9 +1184,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.5" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.85.1" }, - "time": "2025-01-30T17:01:41+00:00" + "time": "2025-07-29T22:23:17+00:00" }, { "name": "php-parallel-lint/php-parallel-lint", @@ -1297,16 +1304,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.1", + "version": "5.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", "shasum": "" }, "require": { @@ -1355,9 +1362,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" }, - "time": "2024-12-07T09:39:29+00:00" + "time": "2025-04-13T19:20:35+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1419,16 +1426,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.0.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "72e51f7c32c5aef7c8b462195b8c599b11199893" + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/72e51f7c32c5aef7c8b462195b8c599b11199893", - "reference": "72e51f7c32c5aef7c8b462195b8c599b11199893", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", "shasum": "" }, "require": { @@ -1460,9 +1467,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.2.0" }, - "time": "2025-02-13T12:25:43+00:00" + "time": "2025-07-13T07:04:09+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1785,16 +1792,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", + "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", "shasum": "" }, "require": { @@ -1805,7 +1812,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -1816,11 +1823,11 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", + "sebastian/comparator": "^4.0.9", "sebastian/diff": "^4.0.6", "sebastian/environment": "^5.1.5", "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", + "sebastian/global-state": "^5.0.8", "sebastian/object-enumerator": "^4.0.4", "sebastian/resource-operations": "^3.0.4", "sebastian/type": "^3.2.1", @@ -1868,7 +1875,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.24" }, "funding": [ { @@ -1879,12 +1886,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-08-10T08:32:42+00:00" }, { "name": "psr/clock", @@ -2039,16 +2054,16 @@ }, { "name": "psr/log", - "version": "3.0.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", "shasum": "" }, "require": { @@ -2057,7 +2072,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2083,9 +2098,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" + "source": "https://github.com/php-fig/log/tree/2.0.0" }, - "time": "2024-09-11T13:17:53+00:00" + "time": "2021-07-14T16:41:46+00:00" }, { "name": "sebastian/cli-parser", @@ -2256,16 +2271,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -2318,15 +2333,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", @@ -2593,16 +2620,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -2645,15 +2672,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", @@ -2826,16 +2865,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -2877,15 +2916,27 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", @@ -3120,16 +3171,16 @@ }, { "name": "symfony/console", - "version": "v6.4.17", + "version": "v6.4.24", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" + "reference": "59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", + "url": "https://api.github.com/repos/symfony/console/zipball/59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350", + "reference": "59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350", "shasum": "" }, "require": { @@ -3194,7 +3245,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.17" + "source": "https://github.com/symfony/console/tree/v6.4.24" }, "funding": [ { @@ -3205,25 +3256,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-12-07T12:07:30+00:00" + "time": "2025-07-30T10:38:54+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { @@ -3236,7 +3291,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -3261,7 +3316,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -3277,20 +3332,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.13", + "version": "v6.4.24", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" + "reference": "75ae2edb7cdcc0c53766c30b0a2512b8df574bd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/75ae2edb7cdcc0c53766c30b0a2512b8df574bd8", + "reference": "75ae2edb7cdcc0c53766c30b0a2512b8df574bd8", "shasum": "" }, "require": { @@ -3327,7 +3382,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.13" + "source": "https://github.com/symfony/filesystem/tree/v6.4.24" }, "funding": [ { @@ -3338,16 +3393,20 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2025-07-10T08:14:14+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -3406,7 +3465,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -3426,7 +3485,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -3484,7 +3543,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -3504,7 +3563,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -3565,7 +3624,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -3585,19 +3644,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -3645,7 +3705,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -3661,20 +3721,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -3692,7 +3752,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -3728,7 +3788,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -3744,20 +3804,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/string", - "version": "v6.4.15", + "version": "v6.4.24", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" + "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "url": "https://api.github.com/repos/symfony/string/zipball/f0ce0bd36a3accb4a225435be077b4b4875587f4", + "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4", "shasum": "" }, "require": { @@ -3814,7 +3874,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.15" + "source": "https://github.com/symfony/string/tree/v6.4.24" }, "funding": [ { @@ -3825,12 +3885,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-13T13:31:12+00:00" + "time": "2025-07-10T08:14:14+00:00" }, { "name": "theseer/tokenizer", @@ -4058,10 +4122,12 @@ }, "prefer-stable": false, "prefer-lowest": false, - "platform": {}, + "platform": { + "php": ">=8.1 <=8.4" + }, "platform-dev": {}, "platform-overrides": { - "php": "8.1.0" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/lib/AppConfigOverwrite.php b/lib/AppConfigOverwrite.php index 2a2df3f3..b6573d50 100644 --- a/lib/AppConfigOverwrite.php +++ b/lib/AppConfigOverwrite.php @@ -19,10 +19,7 @@ public function setOverwrite(array $overwrite): void { $this->overWrite = $overwrite; } - /** - * @psalm-suppress MethodSignatureMustProvideReturnType - */ - public function getValue($app, $key, $default = null) { + public function getValue(string $app, string $key, ?string $default = null): string { if (isset($this->overWrite[$app]) && isset($this->overWrite[$app][$key])) { return $this->overWrite[$app][$key]; } diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 6765ef64..636e2248 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -25,15 +25,15 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; -use OCP\AppFramework\IAppContainer; use OCP\EventDispatcher\IEventDispatcher; use OCP\IGroupManager; -use OCP\IServerContainer; use OCP\IUserManager; +use OCP\IUserSession; use OCP\Notification\IManager as INotificationManager; use OCP\Share\Events\ShareCreatedEvent; use OCP\User\Events\UserChangedEvent; use OCP\User\Events\UserFirstTimeLoggedInEvent; +use Psr\Container\ContainerInterface; class Application extends App implements IBootstrap { public const APP_ID = 'guests'; @@ -55,26 +55,27 @@ public function register(IRegistrationContext $context): void { public function boot(IBootContext $context): void { // need to cheat here since there's no way to register these in IRegistrationContext $container = $context->getServerContainer(); - $container->get(IUserManager::class)->registerBackend($container->query(UserBackend::class)); - $container->get(IGroupManager::class)->addBackend($container->query(GroupBackend::class)); + $container->get(IUserManager::class)->registerBackend($container->get(UserBackend::class)); + $container->get(IGroupManager::class)->addBackend($container->get(GroupBackend::class)); $this->setupGuestManagement($context->getAppContainer(), $context->getServerContainer()); $this->setupGuestRestrictions($context->getAppContainer(), $context->getServerContainer()); $this->setupNotifications($context->getAppContainer()); - $context->getAppContainer()->query(RestrictionManager::class)->lateSetupRestrictions(); + $context->getAppContainer()->get(RestrictionManager::class)->lateSetupRestrictions(); } - private function setupGuestManagement(IAppContainer $container, IServerContainer $server): void { - $hookManager = $container->query(Hooks::class); + private function setupGuestManagement(ContainerInterface $container, ContainerInterface $server): void { + $hookManager = $container->get(Hooks::class); $server->get(IEventDispatcher::class)->addListener(ShareCreatedEvent::class, [$hookManager, 'handlePostShare']); $server->get(IEventDispatcher::class)->addListener(UserFirstTimeLoggedInEvent::class, [$hookManager, 'handleFirstLogin']); } - private function setupGuestRestrictions(IAppContainer $container, IServerContainer $server): void { - $userSession = $server->getUserSession(); + private function setupGuestRestrictions(ContainerInterface $container, ContainerInterface $server): void { + /** @var IUserSession $userSession */ + $userSession = $server->get(IUserSession::class); $user = $userSession->getUser(); /** @var RestrictionManager $restrictionManager */ - $restrictionManager = $container->query(RestrictionManager::class); + $restrictionManager = $container->get(RestrictionManager::class); if ($user) { $restrictionManager->verifyAccess(); @@ -87,8 +88,8 @@ private function setupGuestRestrictions(IAppContainer $container, IServerContain } } - private function setupNotifications(IAppContainer $container): void { - $notificationManager = $container->query(INotificationManager::class); + private function setupNotifications(ContainerInterface $container): void { + $notificationManager = $container->get(INotificationManager::class); $notificationManager->registerNotifierService(Notifier::class); } } diff --git a/lib/AppWhitelist.php b/lib/AppWhitelist.php index 21beda42..e5cbd09c 100644 --- a/lib/AppWhitelist.php +++ b/lib/AppWhitelist.php @@ -51,7 +51,7 @@ public function __construct( $this->baseUrlLength = strlen($this->baseUrl); } - public function isAppWhitelisted($appId): bool { + public function isAppWhitelisted(string $appId): bool { $whitelist = $this->config->getAppWhitelist(); $alwaysEnabled = explode(',', self::WHITELIST_ALWAYS); @@ -62,7 +62,10 @@ public function isWhitelistEnabled(): bool { return $this->config->useWhitelist(); } - public function isUrlAllowed(IUser $user, $url): bool { + /** + * @param false|string $url + */ + public function isUrlAllowed(IUser $user, string|false $url): bool { if ($this->guestManager->isGuest($user) && $this->isWhitelistEnabled()) { $app = $this->getRequestedApp($url); @@ -95,8 +98,10 @@ public function verifyAccess(IUser $user, IRequest $request): void { /** * Core has \OC::$REQUESTEDAPP but it isn't set until the routes are matched * taken from \OC\Route\Router::match() + * + * @param false|string $url */ - private function getRequestedApp($url): string { + private function getRequestedApp(string|false $url): string { if (substr($url, 0, $this->baseUrlLength) === $this->baseUrl) { $url = substr($url, $this->baseUrlLength); } diff --git a/lib/Config.php b/lib/Config.php index 8b82427c..3b5c5fea 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -31,7 +31,7 @@ public function allowExternalStorage(): bool { /** * @param string|bool $allow */ - public function setAllowExternalStorage($allow) { + public function setAllowExternalStorage($allow): void { $this->appConfig->setAppValueBool('allow_external_storage', $allow === true || $allow === 'true') ; } @@ -57,7 +57,7 @@ public function useWhitelist(): bool { /** * @param string|bool $use */ - public function setUseWhitelist($use) { + public function setUseWhitelist($use): void { $this->appConfig->setAppValueBool('usewhitelist', $use === true || $use === 'true') ; } @@ -94,7 +94,7 @@ public function canCreateGuests(): bool { || $this->subAdmin->isSubAdmin($user)) { return true; } - + // Check if we have a group restriction // and if the user belong to that group $groupRestriction = $this->getCreateRestrictedToGroup(); diff --git a/lib/FilteredSettingsManager.php b/lib/FilteredSettingsManager.php index e9fe493e..8afe1b45 100644 --- a/lib/FilteredSettingsManager.php +++ b/lib/FilteredSettingsManager.php @@ -28,10 +28,16 @@ private function isSettingAllowed(string $setting): bool { return $this->appWhitelist->isAppWhitelisted($appId); } + /** + * @return void + */ public function registerSection(string $type, string $section) { $this->manager->registerSection($type, $section); } + /** + * @return void + */ public function registerSetting(string $type, string $setting) { if (!$this->isSettingAllowed($setting)) { return; diff --git a/lib/GroupBackend.php b/lib/GroupBackend.php index d9cdea50..3371d2c5 100644 --- a/lib/GroupBackend.php +++ b/lib/GroupBackend.php @@ -73,7 +73,7 @@ public function inGroup($uid, $gid): bool { * Get all groups a user belongs to * * @param string $uid Name of the user - * @return array an array of group names + * @return list an array of group names * @since 4.5.0 * * This function fetches all groups a user belongs to. It does not check @@ -120,7 +120,7 @@ public function groupExists($gid): bool { * @param string $search * @param int $limit * @param int $offset - * @return array an array of user ids + * @return array an array of user ids * @since 4.5.0 */ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0): array { diff --git a/lib/GuestManager.php b/lib/GuestManager.php index 5db7917a..a242704e 100644 --- a/lib/GuestManager.php +++ b/lib/GuestManager.php @@ -84,9 +84,9 @@ public function createGuest(?IUser $createdBy, string $userId, string $email, st // generate token for lost password so that a link can be sent by email $token = $this->secureRandom->generate( 21, - ISecureRandom::CHAR_DIGITS . - ISecureRandom::CHAR_LOWER . - ISecureRandom::CHAR_UPPER); + ISecureRandom::CHAR_DIGITS + . ISecureRandom::CHAR_LOWER + . ISecureRandom::CHAR_UPPER); $endOfTime = PHP_INT_MAX - 50000; $token = sprintf('%s:%s', $endOfTime, $token); @@ -149,7 +149,7 @@ private function getShareCountForUsers(array $guests): array { return $data; } - public function getGuestInfo($userId): array { + public function getGuestInfo(string $userId): array { $shares = array_merge( $this->shareManager->getSharedWith($userId, IShare::TYPE_USER, null, -1, 0), $this->shareManager->getSharedWith($userId, IShare::TYPE_GROUP, null, -1, 0), diff --git a/lib/Listener/BeforeUserManagementRenderedListener.php b/lib/Listener/BeforeUserManagementRenderedListener.php index 28eb6bb9..83807049 100644 --- a/lib/Listener/BeforeUserManagementRenderedListener.php +++ b/lib/Listener/BeforeUserManagementRenderedListener.php @@ -18,6 +18,9 @@ * @template-implements IEventListener */ class BeforeUserManagementRenderedListener implements IEventListener { + /** + * @param Event $event + */ public function handle(Event $event): void { if (!($event instanceof BeforeTemplateRenderedEvent)) { return; diff --git a/lib/Listener/LoadAdditionalScriptsListener.php b/lib/Listener/LoadAdditionalScriptsListener.php index 9d431ea2..c3855aac 100644 --- a/lib/Listener/LoadAdditionalScriptsListener.php +++ b/lib/Listener/LoadAdditionalScriptsListener.php @@ -26,6 +26,9 @@ public function __construct( ) { } + /** + * @param Event $event + */ public function handle(Event $event): void { // If the user cannot create guests, we don't need to load the script if (!$this->config->canCreateGuests()) { diff --git a/lib/Mail.php b/lib/Mail.php index 913cbff5..09700b57 100644 --- a/lib/Mail.php +++ b/lib/Mail.php @@ -111,8 +111,8 @@ public function sendGuestInviteMail(string $uid, string $shareWith, Share\IShare $message->setHtmlBody($emailTemplate->renderHtml()); $message->setPlainBody($emailTemplate->renderText()); $message->setFrom([ - Util::getDefaultEmailAddress('sharing-noreply') => - $l10n->t('%s via %s', [ + Util::getDefaultEmailAddress('sharing-noreply') + => $l10n->t('%s via %s', [ $senderDisplayName, $this->defaults->getName() ]), diff --git a/lib/Migration/OwncloudGuestsMigration.php b/lib/Migration/OwncloudGuestsMigration.php index 146a20fa..9b807300 100644 --- a/lib/Migration/OwncloudGuestsMigration.php +++ b/lib/Migration/OwncloudGuestsMigration.php @@ -61,7 +61,7 @@ protected function shouldRun(): bool { * 4. Delete the old 'isGuest' preference row * 5. Set the quota to '0 B' */ - protected function runStep(IOutput $output) { + protected function runStep(IOutput $output): void { $output->startProgress(count($this->cachedUserIDs)); foreach ($this->cachedUserIDs as $userID) { if ($ocGuest = $this->userManager->get($userID)) { diff --git a/lib/Repair/ResetEmails.php b/lib/Repair/ResetEmails.php index 2cbb2f86..5c5b9e93 100644 --- a/lib/Repair/ResetEmails.php +++ b/lib/Repair/ResetEmails.php @@ -26,11 +26,14 @@ public function getName(): string { return 'Reset the email of all guest accounts'; } + /** + * @return void + */ public function run(IOutput $output) { foreach ($this->guestManager->listGuests() as $guestId) { $guest = $this->userManager->get($guestId); - if (strtolower($guest->getSystemEMailAddress() ?? '') !== strtolower($guestId)) { - $this->config->setUserValue($guestId, 'guests', 'old_email', $guest->getSystemEMailAddress()); + if (strtolower($guest?->getSystemEMailAddress() ?? '') !== strtolower($guestId)) { + $this->config->setUserValue($guestId, 'guests', 'old_email', $guest?->getSystemEMailAddress() ?? ''); $guest->setSystemEMailAddress(strtolower($guestId)); } } diff --git a/lib/UserBackend.php b/lib/UserBackend.php index f0f7b260..8eff7192 100644 --- a/lib/UserBackend.php +++ b/lib/UserBackend.php @@ -50,7 +50,7 @@ public function __construct( $this->cache = new CappedMemoryCache(); } - public function setAllowListing(bool $allow) { + public function setAllowListing(bool $allow): void { $this->allowListing = $allow; } diff --git a/psalm.xml b/psalm.xml index 2248cd80..c47a2a6a 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,62 +4,49 @@ - SPDX-License-Identifier: AGPL-3.0-or-later --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 2b1a991a..11939669 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -3,20 +3,15 @@ - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors - SPDX-License-Identifier: AGPL-3.0-or-later --> - - - - public function getValue($app, $key, $default = null) { - - + - listen + - ExternalMountPoint + diff --git a/tests/unit/Controller/UsersControllerTest.php b/tests/unit/Controller/UsersControllerTest.php index 84d9110c..62f8a6fc 100644 --- a/tests/unit/Controller/UsersControllerTest.php +++ b/tests/unit/Controller/UsersControllerTest.php @@ -135,7 +135,7 @@ public function testCreateFailsWithNoUserSession() { // Empty user session will return false straight away $this->assertFalse($this->guestsConfig->canCreateGuests()); - + $response = $this->controller->create('test@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_FORBIDDEN, $response->getStatus()); $this->assertEquals(['errorMessages' => ['You are not allowed to create guests']], $response->getData()); @@ -149,24 +149,24 @@ public function testCreateFailsWhenUserNotInAllowedGroups() { $currentUser = $this->createMock(IUser::class); $currentUser->method('getUID') ->willReturn('test_user'); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // Set up group restriction check $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn(['allowed_group1', 'allowed_group2']); - + // User's groups don't intersect with allowed groups $this->groupManager->method('getUserGroupIds') ->with($currentUser) ->willReturn(['other_group1', 'other_group2']); - + $response = $this->controller->create('test@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_FORBIDDEN, $response->getStatus()); $this->assertEquals(['errorMessages' => ['You are not allowed to create guests']], $response->getData()); @@ -180,19 +180,19 @@ public function testCreateSucceedsForAdminDespiteGroupRestrictions() { $currentUser = $this->createMock(IUser::class); $currentUser->method('getUID') ->willReturn('admin_user'); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // Set up group restriction check $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn(['allowed_group1', 'allowed_group2']); - + // User is in the admin group $this->groupManager->method('getUserGroupIds') ->with($currentUser) @@ -202,24 +202,24 @@ public function testCreateSucceedsForAdminDespiteGroupRestrictions() { $this->groupManager->method('isAdmin') ->with('admin_user') ->willReturn(true); - + // Other necessary mocks for a successful creation $this->mailer->method('validateMailAddress') ->willReturn(true); - + $this->userManager->method('getByEmail') ->willReturn([]); - + $this->userManager->method('userExists') ->willReturn(false); - + $guestUser = $this->createMock(IUser::class); $this->guestManager->method('createGuest') ->willReturn($guestUser); - + $this->userManager->method('get') ->willReturn($guestUser); - + $response = $this->controller->create('new@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); } @@ -232,41 +232,41 @@ public function testCreateSucceedsWhenUserInAllowedGroup() { $currentUser = $this->createMock(IUser::class); $currentUser->method('getUID') ->willReturn('test_user'); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // Set up group restriction check $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn(['allowed_group1', 'allowed_group2']); - + // User is in one of the allowed groups $this->groupManager->method('getUserGroupIds') ->with($currentUser) ->willReturn(['other_group', 'allowed_group2']); - + // Other necessary mocks for a successful creation $this->mailer->method('validateMailAddress') ->willReturn(true); - + $this->userManager->method('getByEmail') ->willReturn([]); - + $this->userManager->method('userExists') ->willReturn(false); - + $guestUser = $this->createMock(IUser::class); $this->guestManager->method('createGuest') ->willReturn($guestUser); - + $this->userManager->method('get') ->willReturn($guestUser); - + $response = $this->controller->create('new@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); } @@ -286,24 +286,24 @@ public function testCreateSucceedsForSubAdminWhenSharingIsRestricted() { $this->groupManager->method('get') ->with('allowed_group1') ->willReturn($group); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // No group restrictions $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn([]); - + // Sharing is restricted to group $this->config->method('getAppValue') ->with('core', 'shareapi_only_share_with_group_members', 'no') ->willReturn('yes'); - + // User is a subadmin $this->subAdmin->method('isSubAdmin') ->with($currentUser) @@ -311,27 +311,27 @@ public function testCreateSucceedsForSubAdminWhenSharingIsRestricted() { $this->subAdmin->method('isSubAdminOfGroup') ->with($currentUser, $group) ->willReturn(true); - + // Other necessary mocks for a successful creation $this->mailer->method('validateMailAddress') ->willReturn(true); - + $this->userManager->method('getByEmail') ->willReturn([]); - + $this->userManager->method('userExists') ->willReturn(false); - + $guestUser = $this->createMock(IUser::class); $this->guestManager->method('createGuest') ->willReturn($guestUser); - + $this->userManager->method('get') ->willReturn($guestUser); $this->assertTrue($this->guestsConfig->canCreateGuests()); $this->assertTrue($this->guestsConfig->isSharingRestrictedToGroup()); - + $response = $this->controller->create('new@example.com', 'Test User', 'en', ['allowed_group1']); $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); } @@ -344,29 +344,29 @@ public function testCreateFailsForNonSubAdminWhenSharingIsRestricted() { $currentUser = $this->createMock(IUser::class); $currentUser->method('getUID') ->willReturn('regular_user'); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // No group restrictions $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn([]); - + // Sharing is restricted to group $this->config->method('getAppValue') ->with('core', 'shareapi_only_share_with_group_members', 'no') ->willReturn('yes'); - + // User is NOT a subadmin $this->subAdmin->method('isSubAdmin') ->with($currentUser) ->willReturn(false); - + $response = $this->controller->create('test@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_FORBIDDEN, $response->getStatus()); $this->assertEquals(['errorMessages' => ['You are not allowed to create guests']], $response->getData()); @@ -380,41 +380,41 @@ public function testCreateSucceedsWhenNoRestrictions() { $currentUser = $this->createMock(IUser::class); $currentUser->method('getUID') ->willReturn('regular_user'); - + $this->userSession->method('getUser') ->willReturn($currentUser); - + $this->guestManager->method('isGuest') ->with($currentUser) ->willReturn(false); - + // No group restrictions $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn([]); - + // Sharing is restricted to group $this->config->method('getAppValue') ->with('core', 'shareapi_only_share_with_group_members', 'no') ->willReturn('no'); - + // Other necessary mocks for a successful creation $this->mailer->method('validateMailAddress') ->willReturn(true); - + $this->userManager->method('getByEmail') ->willReturn([]); - + $this->userManager->method('userExists') ->willReturn(false); - + $guestUser = $this->createMock(IUser::class); $this->guestManager->method('createGuest') ->willReturn($guestUser); - + $this->userManager->method('get') ->willReturn($guestUser); - + $response = $this->controller->create('new@example.com', 'Test User', 'en', []); $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); } @@ -702,7 +702,7 @@ public function testCreateSuccessWithGroupsAsSubadmin() { $this->appConfig->method('getAppValueArray') ->with('create_restricted_to_group', []) ->willReturn(['group1', 'group2']); - + // User's groups don't intersect with allowed groups $this->groupManager->method('getUserGroupIds') ->with($currentUser) @@ -712,7 +712,7 @@ public function testCreateSuccessWithGroupsAsSubadmin() { $this->config->method('getAppValue') ->with('core', 'shareapi_only_share_with_group_members', 'no') ->willReturn('yes'); - + $this->assertTrue($this->guestsConfig->canCreateGuests()); $this->assertTrue($this->guestsConfig->isSharingRestrictedToGroup());