File tree Expand file tree Collapse file tree 1 file changed +49
-1
lines changed
tests/PHPStan/Analyser/data Expand file tree Collapse file tree 1 file changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,55 @@ function (): void {
258258 }
259259};
260260
261- /*function (bool $b, bool $c): void {
261+ /*function (): void {
262+ $from = null;
263+ $to = null;
264+ if (rand(0, 1)) {
265+ $from = new \stdClass();
266+ $to = new \stdClass();
267+ }
268+
269+ if (rand(0, 1)) {
270+ $from = new \stdClass();
271+ $to = new \stdClass();
272+ }
273+
274+ if ($from !== null) {
275+ assertType('stdClass', $to);
276+ }
277+ };
278+
279+ function (bool $b): void {
280+ $from = null;
281+ $to = null;
282+ if ($b) {
283+ $from = new \stdClass();
284+ $to = new \stdClass();
285+ }
286+
287+ if ($from !== null) {
288+ assertType('true', $b);
289+ assertType('stdClass', $from);
290+ assertType('stdClass', $to);
291+ }
292+ };
293+
294+ function (bool $b): void {
295+ $from = null;
296+ $to = null;
297+ if ($b) {
298+ $from = new \stdClass();
299+ $to = new \stdClass();
300+ }
301+
302+ if ($b) {
303+ assertType('true', $b);
304+ assertType('stdClass', $from);
305+ assertType('stdClass', $to);
306+ }
307+ };
308+
309+ function (bool $b, bool $c): void {
262310 if ($b) {
263311 if ($c) {
264312 $foo = 'bla';
You can’t perform that action at this time.
0 commit comments