Skip to content

Commit 8528805

Browse files
committed
Suppress false positive type issues from JSON service and its unit test class
1 parent 69e3165 commit 8528805

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Utils/JSON.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class JSON
2424
* @see http://php.net/manual/en/function.json-encode.php
2525
* @see http://php.net/manual/en/function.json-last-error.php
2626
*
27+
* @psalm-suppress FalsableReturnStatement
28+
* @psalm-suppress InvalidFalsableReturnType
29+
*
2730
* @param mixed $input The value being encoded. Can be any type except a resource.
2831
* @param int|null $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS,
2932
* JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT,

tests/Unit/Utils/JSONTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ public static function dataProviderTestThatDecodeThrowsAnExceptionOnMalformedJso
201201
/**
202202
* Data provider for 'testThatEncodeThrowsAnExceptionOnInvalidUtfCharacters'.
203203
*
204+
* @psalm-suppress MoreSpecificReturnType
205+
*
204206
* @return Generator<array{0: string}>
205207
*/
206208
public static function dataProviderTestThatEncodeThrowsAnExceptionOnInvalidUtfCharacters(): Generator

0 commit comments

Comments
 (0)