Released version 4.0.0
This release takes advantage of all the new features of PHP 8 and cleans up some issues in the API.
- uses PHP 8 typehints & property typehints
- Dumper: prints comma after last argument
Stricter behaviour:
- ClassType::add*() throws exception when method/property/etc already exists
- PhpNamespace::add*() throws exception when class/function already exists
Changes:
- ClassType::addTrait() returns new class TraitUse instead of
$this - ClassType::getTraits() returns TraitUse[] instead of string[]
- Method: body is always string, even for interfaces
- ClassType::setConstants() and setTraits() accepts array of Constant resp TraitUse objects only
Deprecations:
- deprecated magic properties (BC break)
ClassType::withBodiesFrom()replaced withfrom(..., withBodies: true)GlobalFunction::withBodyFrom()replaced withfrom(..., withBody: true)- ClassType::from() & Factory::fromClassReflection(): removed parameter $materializeTraits