Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

4.8.0: API changes, require HHVM 4.8

Compare
Choose a tag to compare
@fredemmott fredemmott released this 03 Jun 22:54

This release:

  • requires HHVM 4.8 due to changes in parser output
  • renames HHAST\EditableNode to HHAST\Node, and HHAST\EditableList to HHAST\NodeList; 'editable' was a misleading historical artifact
  • removes magic NodeList::getItems() and NodeList::getItemsOfType($classname) wrappers, which would behave differently depending on if the children were ListItems or not
  • makes ListItem generic in terms of the single child class
  • adds NodeList::getChildrenOfItems() as a clearer, type-safe, less magic replacement of NodeList::getItems(), which is only available if the NodeList is a NodeList<ListItem<T>>
  • also added NodeList::getChildrenOfItemsOfType($classname) as a replacement for NodeList::getItemsOfType()
  • makes vendor/bin/hhast-* hack executables instead of shell script wrappers

In most cases, code directly using HHAST (such as custom linters) can be migrated with:

find linters/ -type f | xargs sed -i 's/EditableList/NodeList/g'
find linters/ -type f | xargs sed -i 's/Editable//g'
find linters/ -type f | xargs sed -i 's/getItems/getChildrenOfItems/g'

For MacOS, replace sed with gsed from the gnu-sed homebrew package.