Php Generator Versions Save

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.

v4.0.5

1 year ago
  • added support for PHP 8.2 features: DNF types, constants in traits, readonly classes, Type::True
  • Type: constants are PascalCase
  • Extractor: keeps the first comment in the method #119
  • Printer: allow customizing comment formatting through protected printDocComment (#118)
  • Helpers::formatDocComment() added option $forceMultiLine
  • Factory: object class contains path from root namespace (#117)
  • Extractor: Fixed extracting enum method body #115 (#116)
  • PhpNamespace: better use-statements sorting behavior

v3.6.9

1 year ago
  • Extractor: keeps the first comment in the method #119
  • Factory: object class contains path from root namespace (#117)
  • Extractor: Fixed extracting enum method body #115 (#116)
  • Type: constants are PascalCase

v4.0.3

1 year ago
  • support for PHP 8.2
  • Dumper::dumpObject() refactoring
  • Printer: added $linesBetweenUseTypes (#114)

v3.6.8

1 year ago
  • support for PHP 8.2
  • Extractor: added support for Readonly promoted parameters (#111)

v4.0.2

1 year ago
  • Printer: added $bracesOnNextLine #112
  • Extractor: added support for Readonly promoted parameters (#111)
  • Printer: refactoring
  • Dumper: supports __serialize()
  • Dumper, Helpers::formatDocComment(), Printer::printFunction() & etc normalizes whitespace
  • Printer: always prints trailing comma #106
  • TraitType: traits cannot have constants

v4.0.1

2 years ago
  • ClassType divided into InterfaceType, TraitType & EnumType
  • Enum: value can be expression
  • Extractor: supports promoted parameters #103
  • Extractor: maintains exact visibility
  • PhpNamespace: added removeUse() #102
  • constants are PascalCase
  • strict fixes
  • ClassType::__clone() clones traits

v3.6.7

2 years ago
  • Extractor: supports promoted parameters #103
  • Extractor: maintains exact visibility
  • PhpNamespace: added removeUse() #102
  • constants are PascalCase
  • ClassType::__clone() clones traits

v4.0.0

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

v3.6.6

2 years ago
  • Extractor: preserves the first comment in the file #100
  • PhpNamespace: added removeClass() & removeFunction()
  • coding style

This is the last 3.6.x release.

v4.0.0-RC1

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