Skip to content

Releases: nette/php-generator

Released version 3.6.4

26 Oct 09:32
@dg dg
Compare
Choose a tag to compare
  • use-statements for functions & constants
  • ClassType: method names are case insensitive
  • PhpNamespace: class and function names are case-insensitive
  • PhpNamespace: addUse() & simplifyName() is case-insensitive
  • PhpNamespace::simplifyName() fixed collision when alias already exists
  • PhpNamespace: improved collision checking between class and alias
  • PhpNamespace::addUse() removed parameter $aliasOut (BC break)
  • PhpNamespace::addUse() simplified aliases generation
  • Factory: supports 'new' in parameters
  • accept numeric array keys when validating types #91

Released version 3.6.2

24 Sep 11:32
@dg dg
Compare
Choose a tag to compare
  • Printer: added property $wrapLength #55 #56
  • getType(), getReturnType(): added option $asObject that returns Nette\Utils\Type
  • Factory: constant values are tagged for resolving
  • Resolving of names in body & literals #85
  • "use Trait" can have comments #90
  • added TraitUse, represents use-statement
  • PhpNamespace::simplifyType() supports generics like Foo<A, B>
  • PhpNamespace::unresolveName() renamed to simplifyName()
  • Helpers::unindent() fixed when level = 0
  • Dumper::format() placeholder ? must not be followed by \w
  • Dumper: added $indentation
  • Dumper: refactoring
  • Printer: refactoring, added property $dumper
  • Printer: refactoring, added property $namespace
  • Revert "Dumper: dumps Closure as PHP code" (BC break)
  • PhpNamespace::addUse() added validation
  • checks reserved class names
  • added validator for types
  • added Property and Parameter validation
  • improved validation error messages
  • Escapes */ in comments

Released version 3.6.1

17 Sep 15:39
@dg dg
Compare
Choose a tag to compare
  • added ClassType::fromCode() & PhpFile::fromCode() #79
  • Factory::fromClassReflection() added option to materialize traits or not #89
  • PhpFile, PhpNamespace: can contain functions [Closes #80]
  • PhpFile: added getClasses()
  • Factory: generates trait resolutions
  • ClassType: constants are 'public' by default
  • Dumper: prints closures as func(...) in PHP 8.1

Released version 3.6.0

25 Aug 11:16
@dg dg
Compare
Choose a tag to compare
  • support for PHP 8.1
  • added support for enums
  • added support for intersection types foo&bar
  • added support for final constants
  • added support for readonly properties
  • added 'never' built-in type
  • Literal: accepts parameters
  • Dumper: can dump static Closure
  • ClassType: setInterface() & setTrait() replaced with interface() & trait() factories
  • requires PHP 7.2

Released version 3.5.4 (EOL)

05 Jul 12:05
@dg dg
Compare
Choose a tag to compare
  • Dumper: dumps Closure as PHP code
  • type '?xyz' sets nullable flag
  • Printer: prints fn() without space

Branch 3.5 is no longer supported

Released version 3.5.3

24 Feb 19:43
@dg dg
Compare
Choose a tag to compare
  • re-fixed [Closes #72]
  • Printer: parameter wrapping counts with function name length [Closes #77]

Released version 3.5.2

19 Jan 13:06
@dg dg
Compare
Choose a tag to compare
  • Printer: fixed combination nullable + mixed #74
  • Printer: fixed combination nullable + union type #72
  • Property::setValue() automatically turns on initialized state #71

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

Released version 3.5.0

02 Nov 16:29
@dg dg
Compare
Choose a tag to compare

Supports all new PHP 8 features!

  • implemented support for PHP 8 attributes
  • implemented support for PHP 8 union types
  • implemented PHP 8 constructor property promotion
  • Factory: supports attributes in PHP 8
  • Dumper::format() syntax ...? now supports named parameters (possible BC break)
  • Printer: prints trailing comma in parameter lists when PHP 8 syntax is used
  • Factory: loads method bodies from traits
  • PhpFile::addNamespace() accepts PhpNamespace object (#68)

BLOG POST https://blog.nette.org/en/news-in-phpgenerator-3-5

Released version 3.4.1 (EOL)

25 Jun 12:05
@dg dg
Compare
Choose a tag to compare
  • PHP-safe indentation replaced with Helpers::unindent() because requires too much memory
  • Factory: fix method bodies import #61 (#62)
  • Factory::extractBody() replaces multi-line & HEREDOC strings with single-line
  • Printer: added $returnTypeColon #63
  • Printer: added $linesBetweenProperties #60
  • added support for PHP 8.0 types mixed, static, false, null

This is the last 3.4.x release.

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