Skip to content

Commit da959af

Browse files
committed
fix(JsonFormatter): Remove unnecessary array check in JSON decoding.
1 parent f736723 commit da959af

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/console": "^6.0|^7.0"
2222
},
2323
"require-dev": {
24-
"infection/infection": "^0.28|^0.32",
24+
"infection/infection": "^0.27|^0.32",
2525
"maglnet/composer-require-checker": "^4.7",
2626
"php-forge/support": "^0.3",
2727
"phpstan/extension-installer": "^1.4",
@@ -30,7 +30,6 @@
3030
"phpunit/phpunit": "^10.5",
3131
"rector/rector": "^2.2",
3232
"symplify/easy-coding-standard": "^13.0",
33-
"vimeo/psalm": "^5.26.1|^6.4.1",
3433
"xepozz/internal-mocker": "^1.4"
3534
},
3635
"config": {

src/Json/JsonFormatter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ private static function formatInternal(string $json, bool $unescapeUnicode, bool
106106

107107
$array = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
108108

109-
if (!is_array($array)) {
110-
return $json;
111-
}
112-
113109
if ($unescapeUnicode) {
114110
array_walk_recursive($array, static function (mixed &$item): void {
115111
if (is_string($item)) {

0 commit comments

Comments
 (0)