Skip to content

Commit

Permalink
fix mixed test not actually checking mixed (since superglobals have a…
Browse files Browse the repository at this point in the history
… more specific type now)
  • Loading branch information
kkmuffme committed Jan 13, 2024
1 parent 92088c2 commit e925151
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/TypeReconciliation/ConditionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1168,11 +1168,19 @@ function Foo($width, $height) : void {
],
'notEmptyCheckOnMixedInTernary' => [
'code' => '<?php
$a = !empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" ? true : false;',
/** @psalm-suppress InvalidReturnType */
function foo(): array {}
$b = foo();
$a = !empty($b["hello"]) && $b["hello"] !== "off" ? true : false;',
],
'notEmptyCheckOnMixedInIf' => [
'code' => '<?php
if (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off") {
/** @psalm-suppress InvalidReturnType */
function foo(): array {}
$b = foo();
if (!empty($b["hello"]) && $b["hello"] !== "off") {
$a = true;
} else {
$a = false;
Expand Down

0 comments on commit e925151

Please sign in to comment.