From 5650630b30dd597238d18d922e5731034e37e836 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 7 Mar 2023 00:21:19 +0000 Subject: [PATCH] Fix incorrect psalm-returns Signed-off-by: Kamil Tekiela --- psalm-baseline.xml | 177 --------------------------- test/classes/Display/ResultsTest.php | 26 ++-- 2 files changed, 13 insertions(+), 190 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 99017035a6..157e6309f8 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -15341,183 +15341,6 @@ assertSame - - [BLOB - 4 B]' - . '' . "\n", - ], - [ - 'noblob', - '1001', - 'grid_edit', - $meta, - [], - $url_params, - false, - $transformation_plugin, - [], - '' - . '1001' - . '' . "\n", - ], - [ - 'noblob', - null, - 'grid_edit', - $meta2, - [], - $url_params, - false, - $transformation_plugin, - [], - '' . "\n" - . ' NULL' . "\n" - . '' . "\n", - ], - [ - 'all', - 'foo bar baz', - 'grid_edit', - $meta2, - [], - $url_params, - false, - null, - [], - 'foo bar baz' . "\n", - ], - [ - 'all', - 'foo bar baz', - 'grid_edit', - $meta2, - [], - $url_params, - false, - $transformation_plugin_external, - [], - 'foo bar baz' . "\n", - ], - [ - 'all', - '2020-09-20 16:35:00', - 'grid_edit', - $meta3, - [], - $url_params, - false, - null, - [], - '2020-09-20 16:35:00' . "\n", - ], - ]]]> - 1001', - ], - [ - true, - true, - 'BLOB', - hex2bin('123456'), - null, - [], - $meta, - $url_params, - null, - 'class="disableAjax">0x123456', - ], - [ - true, - false, - 'BLOB', - '1001', - null, - [], - $meta, - $url_params, - null, - 'class="disableAjax">[BLOB - 4 B]', - ], - [ - false, - false, - 'BINARY', - '1001', - $transformation_plugin, - [], - $meta, - $url_params, - null, - '1001', - ], - [ - false, - true, - 'GEOMETRY', - null, - null, - [], - $meta, - $url_params, - null, - '[GEOMETRY - NULL]', - ], - ]]]> - - - array{array{ - * bool, - * bool, - * string, - * string|null, - * TransformationsPlugin|null, - * array|object, - * object, - * array, - * bool|null, - * string - * }} - array{array{ - * string, - * string|null, - * string, - * object, - * array, - * array, - * bool, - * TransformationsPlugin|null, - * array, - * string - * }} - $output $output diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index f4a7df9b07..a1537a168c 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -466,7 +466,7 @@ class ResultsTest extends AbstractTestCase /** * @return mixed[][] - * @psalm-return array{array{ + * @psalm-return array */ public static function dataProviderForTestHandleNonPrintableContents(): array { @@ -499,19 +499,19 @@ class ResultsTest extends AbstractTestCase [], $meta, $url_params, - null, + false, 'class="disableAjax">1001', ], [ true, true, 'BLOB', - hex2bin('123456'), + (string) hex2bin('123456'), null, [], $meta, $url_params, - null, + false, 'class="disableAjax">0x123456', ], [ @@ -523,7 +523,7 @@ class ResultsTest extends AbstractTestCase [], $meta, $url_params, - null, + false, 'class="disableAjax">[BLOB - 4 B]', ], [ @@ -535,7 +535,7 @@ class ResultsTest extends AbstractTestCase [], $meta, $url_params, - null, + false, '1001', ], [ @@ -547,7 +547,7 @@ class ResultsTest extends AbstractTestCase [], $meta, $url_params, - null, + false, '[GEOMETRY - NULL]', ], ]; @@ -561,7 +561,7 @@ class ResultsTest extends AbstractTestCase * @param array|object $transform_options transformation parameters * @param object $meta the meta-information about the field * @param array $url_params parameters that should go to the download link - * @param bool|null $is_truncated the result is truncated or not + * @param bool $is_truncated the result is truncated or not * @param string $output the output of this function * * @dataProvider dataProviderForTestHandleNonPrintableContents @@ -575,7 +575,7 @@ class ResultsTest extends AbstractTestCase array|object $transform_options, object $meta, array $url_params, - bool|null $is_truncated, + bool $is_truncated, string $output, ): void { $_SESSION['tmpval']['display_binary'] = $display_binary; @@ -602,7 +602,7 @@ class ResultsTest extends AbstractTestCase /** * @return mixed[][] - * @psalm-return array{array{ + * @psalm-return array */ public static function dataProviderForTestGetDataCellForNonNumericColumns(): array {