mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix tests
This commit is contained in:
parent
4b36c4e4bf
commit
1b01d7b356
@ -122,7 +122,7 @@ class FunctionCallTest extends TestCase
|
||||
'noRedundantConditionAfterMixedOrEmptyArrayCountCheck' => [
|
||||
'<?php
|
||||
function foo(string $s) : void {
|
||||
$a = json_decode($s) ?: [];
|
||||
$a = $_GET["s"] ?: [];
|
||||
if (count($a)) {}
|
||||
if (!count($a)) {}
|
||||
}',
|
||||
|
@ -1891,13 +1891,13 @@ class ClassTemplateTest extends TestCase
|
||||
|
||||
public function __construct() {
|
||||
$this->FooArray = new Foo(function(string $s): array {
|
||||
/** @psalm-suppress MixedAssignment */
|
||||
$json = \json_decode($s, true);
|
||||
|
||||
if (! \is_array($json)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
/** @var array */
|
||||
return $json;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user