How do you deal with these scenarios in PHPStan:
- Say you're using plain PHP as template engine. E.g.,
// view.php <b><?=$foo?></b>
- Say you have 2 files
a.php
andb.php
// a.php $foo = 'bar'; // b.php require 'a.php'; echo $foo;
PHPStan will both report this as Undefined variable: $foo
How do you deal with this? Can PHPStan be configured to somehow execute your app so it knows that these variables are actually defined during runtime?
$env = loadEnv('../.env'); define('FOO', $env['foo']);
– Kymry