fix(files): conversion api simplification and conflict check #53220
Annotations
5 errors and 1 warning
Psalm:
apps/files/lib/Capabilities.php#L27
apps/files/lib/Capabilities.php:27:13: InvalidReturnType: The declared return type 'array{files: array{'$comment': null|string, bigfilechunking: bool, blacklisted_files: list<mixed>, chunked_upload: array{max_parallel_count: int, max_size: int}, file_conversions: list<array{from: string, to: list<array{mime: string, name: string}>}>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, forbidden_filenames: list<string>}}' for OCA\Files\Capabilities::getCapabilities is incorrect, got 'array{files: array{'$comment': '\"blacklisted_files\" is deprecated as of Nextcloud 30, use \"forbidden_filename...', bigfilechunking: true, blacklisted_files: list<string>, chunked_upload: array{max_parallel_count: int, max_size: int}, file_conversions: list<array{displayName: string, extension: string, from: string, to: string}>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, forbidden_filenames: list<string>}}' which is different due to additional array shape fields (extension, displayName) (see https://psalm.dev/011)
|
Psalm:
apps/files/lib/Capabilities.php#L30
apps/files/lib/Capabilities.php:30:10: InvalidReturnStatement: The inferred type 'array{files: array{'$comment': '\"blacklisted_files\" is deprecated as of Nextcloud 30, use \"forbidden_filename...', bigfilechunking: true, blacklisted_files: list<string>, chunked_upload: array{max_parallel_count: int, max_size: int}, file_conversions: list<array{displayName: string, extension: string, from: string, to: string}>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, forbidden_filenames: list<string>}}' does not match the declared return type 'array{files: array{'$comment': null|string, bigfilechunking: bool, blacklisted_files: list<mixed>, chunked_upload: array{max_parallel_count: int, max_size: int}, file_conversions: list<array{from: string, to: list<array{mime: string, name: string}>}>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, forbidden_filenames: list<string>}}' for OCA\Files\Capabilities::getCapabilities due to additional array shape fields (extension, displayName) (see https://psalm.dev/128)
|
Psalm:
lib/private/Files/Conversion/ConversionManager.php#L71
lib/private/Files/Conversion/ConversionManager.php:71:13: MoreSpecificReturnType: The declared return type 'list<OCP\Files\Conversion\ConversionMimeProvider>' for OC\Files\Conversion\ConversionManager::getProvidersForMime is more specific than the inferred return type 'array<int<0, max>, OCP\Files\Conversion\ConversionMimeProvider>' (see https://psalm.dev/070)
|
Psalm:
lib/private/Files/Conversion/ConversionManager.php#L82
lib/private/Files/Conversion/ConversionManager.php:82:10: LessSpecificReturnStatement: The type 'array<int<0, max>, OCP\Files\Conversion\ConversionMimeProvider>' is more general than the declared return type 'list<OCP\Files\Conversion\ConversionMimeProvider>' for OC\Files\Conversion\ConversionManager::getProvidersForMime (see https://psalm.dev/129)
|
Psalm
Process completed with exit code 2.
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading