New features(CLI, Configs):
-
When stderr is redirected a file or to another program, show an append-only progress bar by default. (#3514)
Phan would previously disable the progress bar entirely by default.The new
--long-progress-bar
CLI flag can be used to choose this progress bar.(The
--no-progress-bar
CLI flag or the environment variablePHAN_DISABLE_PROGRESS_BAR=1
can be used to disable this) -
Treat
$var = $x['possibly undefined offset']
as creating a definitely defined variable,
not a possibly undefined variable. (#3534)The config setting
convert_possibly_undefined_offset_to_nullable
controls
whether the field type gets cast to the nullable equivalent after removing undefined.
New features(Analysis):
- Emit
PhanPossiblyUndefinedArrayOffset
for accesses to array fields that are possibly undefined. (#3534) - Warn about returning/not returning in void/non-void functions.
New issue types:PhanSyntaxReturnValueInVoid
,PhanSyntaxReturnExpectedValue
- Infer that
$var[$offset] = expr;
/$this->prop[$offset] = expr;
causes that element to be non-null (#3546) - Emit
PhanEmptyForeachBody
when iterating over a type that isn'tTraversable
with an empty statement list. - Warn about computing
array_values
for an array that is already a list. (#3540) - Infer the real type is still an array after assigning to a field of an array.
Plugins:
- In
DuplicateExpressionPlugin
, emitPhanPluginDuplicateIfStatements
if the body forelse
is identical to the above body for theif/elseif
.
Maintenance:
- Support native parsing of
AST_TYPE_UNION
(union type) nodes for PHP 8.0.0-dev. - Reduce memory usage after the polyfill/fallback parser parses ASTs
(when the final AST isn't cached on disk from a previous run) - Make the error message for missing
php-ast
contain more detailed instructions on how to installphp-ast
.