github nette/php-generator v4.0.0
Released version 4.0.0

latest releases: v4.1.6, v4.1.5, v4.1.4...
2 years ago

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 with from(..., withBodies: true)
  • GlobalFunction::withBodyFrom() replaced with from(..., withBody: true)
  • ClassType::from() & Factory::fromClassReflection(): removed parameter $materializeTraits

Don't miss a new php-generator release

NewReleases is sending notifications on new releases.