Skip to content

Releases: nette/php-generator

Released version 3.4.0

26 May 16:35
@dg dg
Compare
Choose a tag to compare
  • Factory: reads class constants with visibility & phpDoc
  • Factory: added option to load methods a functions with bodies [Closes #59][Closes #4]
  • implemented PHP-safe indentation
  • Printer: one-line properties without comments are not separated using one empty line
  • Printer: constants with comments are separated using one empty line

Released version 3.3.4 (EOL)

09 Feb 14:40
@dg dg
Compare
Choose a tag to compare
  • ClassType: added removeImplement() & removeTrait() #53
  • Printer: printParameters() is public
  • Printer: added printType()
  • added Factory::fromCallable()
  • added Type::getType()

This is the last 3.3.x release.

Released version 3.3.3

20 Jan 12:03
@dg dg
Compare
Choose a tag to compare
  • ClassType: added new setter/getters for each type
  • VisibilityAware: added new setter/getters for each visibility
  • added Type
  • added Literal as alias for PhpLiteral
  • Dumper: dumped classes are fully qualified
  • Dumper::dumpArray() hides keys only in non-associative arrays #51

For the details you can have a look at the diff.

Released version 3.3.0

20 Nov 16:43
@dg dg
Compare
Choose a tag to compare
  • supports PHP 7.4
  • added support for PHP 7.4 typed properties
  • added Printer::printArrowFunction() for new PHP 7.4 arrow functions
  • added new class Dumper
  • output better respects wrap-length #45 #47
  • default wrap-length changed to 120
  • added setType()/getType()/hasStrictTypes()/hasBracketedSyntax()/isReturnNullable() as future replacements for setTypeHint()/getTypeHint()/getStrictTypes()/getBracketedSyntax()/getReturnNullable()

Released version 3.2.3 (EOL)

05 Jul 13:11
@dg dg
Compare
Choose a tag to compare
  • PsrPrinter: fixed indentation of dumps #41
  • Printer: added printUses()
  • ClassType: added hasProperty() & hasMethod()

This is the last 3.2.x release.

Released version 3.2.2

25 Mar 19:17
@dg dg
Compare
Choose a tag to compare
  • Printer::setTypeResolving() adds ability to print uresolved code #31
  • Helpers::format() is preferred over formatArgs() because we have variadics :)
  • Factory: uses ReflectionNamedType
  • PhpLiteral is not final

For the details you can have a look at the diff.

Released version 3.2.1

29 Nov 18:34
@dg dg
Compare
Choose a tag to compare
  • PhpFile: added addUse() #38
  • Printer: fixed use statements generation
  • PsrPrinter is final

For the details you can have a look at the diff.

Released version 3.1.4 (EOL)

29 Nov 18:35
@dg dg
Compare
Choose a tag to compare
  • Printer: fixed use statements generation

This is the last v3.1.x release.

Released version 3.2.0

09 Aug 15:05
@dg dg
Compare
Choose a tag to compare

New features

  • added Printer, code from __toString moved to Printer
  • added PsrPrinter, compatible with PSR-2 and PSR-12 [Closes #30]
  • added PhpNamespace::add() [Closes #27]
  • added NameAware::cloneWithName()
  • added FunctionLike::removeParameter() & ClassType::removeMethod(), removeProperty(), removeConstant()
  • added ClassType::addMember() [Closes #35]
  • ClassType: implemented deep clone
  • ClassType: added VISIBILITY_* constants
  • PhpFile: added setStrictTypes()

Changes

  • PhpNamespace::add*() - removed checking whether class already exists - to be consistent with the rest of package (BC break)
  • FunctionLike: removed setNamespace() (BC break)
  • ClassType::getNamespace() is softly deprecated. An object can be in multiple namespaces.
  • ClassType, Method: added validate(), prevents classes and methods from declared both final and abstract [BC break] (#36)
  • __toString converts exceptions to errors
  • fine tuned generated coding style

For the details you can have a look at the diff.

Released version 3.1.3

09 Aug 14:43
@dg dg
Compare
Choose a tag to compare
  • ClassType::from() resolves inheriting interfaces #32
  • added ClassType::getTraitResolutions & PhpFile::getNamespaces()
  • optimizations
  • readme.md: improved

For the details you can have a look at the diff.