Skip to content

Commit

Permalink
fix(psalm): Add all missing stubs
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Sep 16, 2024
1 parent 009c3b1 commit 65ff3ad
Show file tree
Hide file tree
Showing 94 changed files with 15,668 additions and 2,368 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
->getFinder()
->ignoreVCSIgnored(true)
->notPath('build')
->notPath('tests/stubs')
->notPath('l10n')
->notPath('src')
->notPath('vendor')
Expand Down
235 changes: 235 additions & 0 deletions LICENSES/AGPL-3.0-only.txt

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ path = ["img/app-dark.svg", "img/app.svg", "img/deny.svg", "img/folder-group.svg
precedence = "aggregate"
SPDX-FileCopyrightText = "2018-2024 Google LLC"
SPDX-License-Identifier = "Apache-2.0"

[[annotations]]
path = ["tests/stubs/doctrine_dbal_**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "MIT"

[[annotations]]
path = ["tests/stubs/symfony_component_**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "MIT"

[[annotations]]
path = ["tests/stubs/stecman_component_**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "MIT"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"nextcloud/ocp": "dev-master"
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './tests/stubs/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm.phar --threads=$(nproc) --no-cache",
Expand Down
120 changes: 86 additions & 34 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,92 @@
findUnusedCode="false"
>
<stubs>
<file name="tests/stub.phpstub" preloadClasses="true"/>
<file name="tests/stubs/doctrine_dbal_schema_abstractasset.php" />
<file name="tests/stubs/doctrine_dbal_schema_column.php" />
<file name="tests/stubs/doctrine_dbal_schema_schema.php" />
<file name="tests/stubs/doctrine_dbal_schema_table.php" />
<file name="tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php" />
<file name="tests/stubs/symfony_component_console_command_command.php" />
<file name="tests/stubs/symfony_component_console_helper_table.php" />
<file name="tests/stubs/symfony_component_console_input_inputargument.php" />
<file name="tests/stubs/symfony_component_console_input_inputinterface.php" />
<file name="tests/stubs/symfony_component_console_input_inputoption.php" />
<file name="tests/stubs/symfony_component_console_output_outputinterface.php" />
<file name="tests/stubs/symfony_component_console_question_confirmationquestion.php" />
<file name="tests/stubs/symfony_component_console_question_confirmationquestion.php" />
<file name="tests/stubs/symfony_component_console_question_question.php" />
<file name="tests/stubs/oca_circles_circlesmanager.php" />
<file name="tests/stubs/oca_circles_circlesqueryhelper.php" />
<file name="tests/stubs/oca_circles_events_circledestroyedevent.php" />
<file name="tests/stubs/oca_circles_events_circleresultgenericevent.php" />
<file name="tests/stubs/oca_circles_exceptions_circlenotfoundexception.php" />
<file name="tests/stubs/oca_circles_exceptions_federateditemexception.php" />
<file name="tests/stubs/oca_circles_exceptions_federateditemnotfoundexception.php" />
<file name="tests/stubs/oca_circles_ientity.php" />
<file name="tests/stubs/oca_circles_ifederateduser.php" />
<file name="tests/stubs/oca_circles_iqueryprobe.php" />
<file name="tests/stubs/oca_circles_model_circle.php" />
<file name="tests/stubs/oca_circles_model_federateduser.php" />
<file name="tests/stubs/oca_circles_model_managedmodel.php" />
<file name="tests/stubs/oca_circles_model_probes_basicprobe.php" />
<file name="tests/stubs/oca_circles_model_probes_circleprobe.php" />
<file name="tests/stubs/oca_circles_model_probes_memberprobe.php" />
<file name="tests/stubs/oca_circles_tools_db_iqueryrow.php" />
<file name="tests/stubs/oca_circles_tools_ideserializable.php" />
<file name="tests/stubs/icewind_streams_iteratordirectory.php" />
<file name="tests/stubs/icewind_streams_wrapperhandler.php" />
<file name="tests/stubs/icewind_streams_directory.php" />
<file name="tests/stubs/oc.php" />
<file name="tests/stubs/oc_appframework_ocs_baseresponse.php" />
<file name="tests/stubs/oc_appframework_ocs_v1response.php" />
<file name="tests/stubs/oc_appframework_utility_simplecontainer.php" />
<file name="tests/stubs/oc_core_command_base.php" />
<file name="tests/stubs/oc_files_cache_cache.php" />
<file name="tests/stubs/oc_files_cache_cacheentry.php" />
<file name="tests/stubs/oc_files_cache_scanner.php" />
<file name="tests/stubs/oc_files_cache_wrapper_cachejail.php" />
<file name="tests/stubs/oc_files_cache_wrapper_cachewrapper.php" />
<file name="tests/stubs/oc_files_filesystem.php" />
<file name="tests/stubs/oc_files_mount_mountpoint.php" />
<file name="tests/stubs/oc_files_node_lazyfolder.php" />
<file name="tests/stubs/oc_files_node_node.php" />
<file name="tests/stubs/oc_files_objectstore_objectstorescanner.php" />
<file name="tests/stubs/oc_files_objectstore_objectstorestorage.php" />
<file name="tests/stubs/oc_files_storage_common.php" />
<file name="tests/stubs/oc_files_storage_storage.php" />
<file name="tests/stubs/oc_files_storage_wrapper_jail.php" />
<file name="tests/stubs/oc_files_storage_wrapper_permissionsmask.php" />
<file name="tests/stubs/oc_files_storage_wrapper_quota.php" />
<file name="tests/stubs/oc_files_storage_wrapper_wrapper.php" />
<file name="tests/stubs/oc_files_view.php" />
<file name="tests/stubs/oc_group_manager.php" />
<file name="tests/stubs/oc_hooks_basicemitter.php" />
<file name="tests/stubs/oc_hooks_emitter.php" />
<file name="tests/stubs/oc_hooks_emittertrait.php" />
<file name="tests/stubs/oc_hooks_publicemitter.php" />
<file name="tests/stubs/oc_server.php" />
<file name="tests/stubs/oc_servercontainer.php" />
<file name="tests/stubs/oc_settings_authorizedgroupmapper.php" />
<file name="tests/stubs/oc_user_user.php" />
<file name="tests/stubs/oca_dav_connector_sabre_directory.php" />
<file name="tests/stubs/oca_dav_connector_sabre_node.php" />
<file name="tests/stubs/oca_dav_connector_sabre_principal.php" />
<file name="tests/stubs/oca_files_event_loadadditionalscriptsevent.php" />
<file name="tests/stubs/oca_files_sharing_event_beforetemplaterenderedevent.php" />
<file name="tests/stubs/oca_files_trashbin_expiration.php" />
<file name="tests/stubs/oca_files_trashbin_trash_itrashbackend.php" />
<file name="tests/stubs/oca_files_trashbin_trash_itrashitem.php" />
<file name="tests/stubs/oca_files_trashbin_trash_trashitem.php" />
<file name="tests/stubs/oca_files_versions_expiration.php" />
<file name="tests/stubs/oca_files_versions_versions_ideletableversionbackend.php" />
<file name="tests/stubs/oca_files_versions_versions_imetadataversion.php" />
<file name="tests/stubs/oca_files_versions_versions_imetadataversionbackend.php" />
<file name="tests/stubs/oca_files_versions_versions_ineedsyncversionbackend.php" />
<file name="tests/stubs/oca_files_versions_versions_iversion.php" />
<file name="tests/stubs/oca_files_versions_versions_iversionbackend.php" />
<file name="tests/stubs/oca_files_versions_versions_iversionsimporterbackend.php" />
<file name="tests/stubs/oca_files_versions_versions_version.php" />
<file name="tests/stubs/oca_settings_service_authorizedgroupservice.php" />
</stubs>
<projectFiles>
<directory name="lib" />
Expand All @@ -30,39 +115,6 @@
</ignoreFiles>
</extraFiles>
<issueHandlers>
<UndefinedMagicMethod>
<errorLevel type="suppress">
<referencedMethod name="/Db\\.*::.*/" />
</errorLevel>
</UndefinedMagicMethod>
<UndefinedInterfaceMethod>
<errorLevel type="suppress">
<!-- FIXME Deprecated event handling -->
<referencedMethod name="OCP\IUserManager::listen" />
<referencedMethod name="OCP\IGroupManager::listen" />
</errorLevel>
</UndefinedInterfaceMethod>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="OC\AppFramework\OCS\V1Response"/>
<referencedClass name="OC\AppFramework\Utility\ControllerMethodReflector"/>
<referencedClass name="OC\Security\CSP\ContentSecurityPolicyNonceManager" />
<referencedClass name="OC\Settings\AuthorizedGroupMapper"/>
<referencedClass name="OCA\Files\Event\LoadAdditionalScriptsEvent"/>
<referencedClass name="OCA\Settings\Service\AuthorizedGroupService"/>
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<referencedClass name="Doctrine\DBAL\Driver\Statement" />
<referencedClass name="Doctrine\DBAL\Schema\Schema" />
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
<referencedClass name="Doctrine\DBAL\Schema\Table" />
<referencedClass name="OC\AppFramework\OCS\BaseResponse"/>
<referencedClass name="OC\Security\CSP\ContentSecurityPolicyNonceManager" />
<referencedClass name="OCA\Settings\Service\AuthorizedGroupService"/>
</errorLevel>
</UndefinedDocblockClass>
<LessSpecificReturnStatement errorLevel="error"/>
<LessSpecificReturnType errorLevel="error"/>
<LessSpecificImplementedReturnType errorLevel="error"/>
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</coverage>
<testsuite name="Nextcloud - Group folders App Tests">
<directory suffix=".php">.</directory>
<exclude>./stubs/</exclude>
</testsuite>
<logging/>
</phpunit>
8 changes: 1 addition & 7 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="lib/ACL/ACLStorageWrapper.php">
<UndefinedClass>
<code><![CDATA[IteratorDirectory]]></code>
</UndefinedClass>
</file>
</files>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0"/>
Loading

0 comments on commit 65ff3ad

Please sign in to comment.