v4.33.6: `hhast-migrate --php-arrays`, await-in-a-loop improvements, support for `.` as a root
hhast-migrate --php-arrays
Added hhast-migrate --php-arrays
to replace PHP array literals with varray[]
and darray[]
literals. Empty array literals will be replaced with darray[]
.
This change should be safe at runtime, unless additional notices are enabled and a user error handler promotes the notices to errors.
If running on HHVM 4.43 or below, both []
and array()
literals are supported; if running on HHVM 4.44 or above, only array()
literals are supported as support for []
has been removed from the parser.
After this migration, consider refactoring any affected code to use vec
, dict
, keyset
, tuples, or shapes instead.
DontAwaitInALoopLinter false positives
foreach (await foo as $_)
(AsyncGenerator
instances) will not raise a lint error, unless it is nested inside another loop- improved the pretty printer to better detect function boundaries
Support for .
as a root
This refers to the project root - the same directory as the .hhconfig
file. This can be useful for projects with multiple top-level source directories. If using .
as a root, it is likely you will wish to exclude vendor/
, and for performance, you might also want to exclude known-irrelevant directories such as node_modules/
, if present.