PackageTrack
Sign in Get early access

nette/php-generator

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.

v4.2.2 79M downloads/mo #324 most downloaded on Packagist nette/php-generator

What this package is like to depend on

Last release 5 months ago

26 Feb 2026

Ships fairly regularly

a new release about every 3 months

Rarely documented

notes for 9 of 78 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

78 releases · first in 2014

2 releases in the last 12 months

see the full history below

Release timeline

78 releases · Jun 2014 to Feb 2026
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 78
  1. v4.2.2 26 Feb 2026
    Release notes

    This release focuses on making namespaces and classes work together more naturally. Classes now know which namespace they belong to, constructors accept fully qualified names, and a new unified add() method on PhpFile ties it all together. Under the hood, the Factory got a thorough refactoring and the codebase passed its first mandatory static analysis check.

    • PhpNamespace::add() now automatically assigns itself as the namespace of any ClassLike passed to it. If your code relied on getNamespace() returning null after adding a class to a namespace, you'll need to update that assumption.

    • PhpFile::add() – a single entry point for adding classes, interfaces, traits, enums, functions, and namespaces to a file. It handles namespace creation and bracket syntax automatically, so you can build a complete file with just add() calls.

    • ClassLike::getFullName() – returns the fully qualified name when the class belongs to a namespace (e.g., App\Model\User), the short name otherwise, or null for anonymous classes.

    • ClassLike constructors now accept FQN – pass 'App\Model\User' and the namespace is extracted automatically. No need to create the namespace separately for simple cases.

    • PhpNamespace::add() accepts GlobalFunction – the unified add() method now handles functions alongside class-like types, making the namespace API more consistent.

    • The $namespace parameter in ClassLike constructors is deprecated. Use setNamespace() instead. The old signature still works for now, but will be removed in a future version.

    Open source →
  2. v4.2.1 09 Feb 2026

    Nothing published for this version

  3. v4.2.0 06 Aug 2025
    Release notes
    • requires PHP 8.1
    • Visibility, PropertyHookType & PropertyAccessMode are enums (BC break)
    • removed deprecated stuff
    • addTrait() second argument is deprecated (BC break)
    Open source →
    Release notes

    OAuth 2.0 authentication for Gmail and Microsoft, one-click unsubscribe headers, Ed25519 DKIM signing, a real CSS cascade for inlining, and a security patch that alone makes updating worth it. Fully backward compatible.

    David Grudl

    about a month ago

    Open source →
  4. v4.1.9 06 Aug 2025
    Release notes
    • support for PHP 8.5
    • final promoted property in PHP 8.5
    • optimized global function calls
    Open source →
  5. v4.1.8 31 Mar 2025
    Release notes
    • Factory::fromClassReflection() extracts property hook bodies (#172)
    • Factory::fromClassReflection() rejects $withBodies for interfaces
    • improved tests
    • cs
    Open source →
  6. v4.1.7 29 Nov 2024
    Release notes
    • added support for PHP 8.4 features
      • properties hooks
      • asymmetric visibility
      • property can be abstract / final
      • interfaces can have properties
    • added Visibility
    • ClassManipulator::implement() can implement abstract classes
    • ClassManipulator::implementInterface() renamed to implement()
    • PsrPrinter is not final
    • Constant: type can be nullable
    • Factory: fixed visibility of promoted property
    Open source →
  7. v4.1.6 10 Sep 2024
    Release notes
    • added ClassManipulator
    • Parameter & Property: isNullable() returns true when default value is null (possible BC break)
    • added TraitsAware::hasTrait method (#163)
    • support for PHP 8.4
    Open source →
  8. v4.1.5 12 May 2024
    Release notes
    • added PhpNamespace::getClass() & getFunction()
    • added CommentAware::removeComment()
    • added PhpFile::removeNamespace()
    • Factory, Extractor: sets flag readonly for promoted properties #158 (reverts "Factory: properties in readonly classes are not readonly")
    • ClassType: cloning includes attributes and parameters
    • GlobalFunction, Method: from() accepts first-class callables
    Open source →
  9. v4.1.4 07 Mar 2024
    Release notes
    • PsrPrinter: opening bracket on the correct line #155
    • Make ClassLike::from return type assert the subclass type (BC break) (#154)
    • Dumper::dumpArray(), dumpArguments() optimization
    • Dumper: simplified list with negative keys
    • added parameter $overwrite to addMember(), addMethod(), addProperty(), addConstant(), addCase() #152
    • Factory: parameters 'int $foo = null' are parsed as '?int'
    Open source →
  10. v4.1.3 18 Jan 2024

    Nothing published for this version

  11. v4.1.2 29 Oct 2023

    Nothing published for this version

  12. v4.1.1 17 Oct 2023

    Nothing published for this version

  13. v4.1.0 26 Sep 2023

    Nothing published for this version

  14. v4.0.10 29 Nov 2024
    Release notes
    • Extractor::extractAll() fixed file comment parsing
    • Factory: $withBodies cannot be used for internal classes/functions
    • Printer: fixed falsy Attribute aren't printed (#142)
    • added Visibility
    Open source →
  15. v4.0.9 29 Aug 2023

    Nothing published for this version

  16. v4.0.8 30 Jul 2023

    Nothing published for this version

  17. v4.0.7 26 Apr 2023

    Nothing published for this version

  18. v4.0.6 13 Mar 2023

    Nothing published for this version

  19. v4.0.5 02 Nov 2022

    Nothing published for this version

  20. v4.0.3 12 Sep 2022

    Nothing published for this version

  21. v4.0.2 17 Jun 2022

    Nothing published for this version

  22. v4.0.1 10 Mar 2022

    Nothing published for this version

  23. v4.0.0 20 Feb 2022

    Nothing published for this version

  24. v3.6.9 04 Oct 2022

    Nothing published for this version

  25. v3.6.8 12 Sep 2022

    Nothing published for this version

  26. v3.6.7 10 Mar 2022

    Nothing published for this version

  27. v3.6.6 20 Feb 2022

    Nothing published for this version

  28. v3.6.5 24 Nov 2021

    Nothing published for this version

  29. v3.6.4 15 Oct 2021

    Nothing published for this version

  30. v3.6.2 23 Sep 2021

    Nothing published for this version

  31. v3.6.1 18 Sep 2021

    Nothing published for this version

  32. v3.6.0 29 Aug 2021

    Nothing published for this version

  33. v3.5.4 05 Jul 2021

    Nothing published for this version

  34. v3.5.3 24 Feb 2021

    Nothing published for this version

  35. v3.5.2 19 Jan 2021

    Nothing published for this version

  36. v3.5.1 04 Nov 2020

    Nothing published for this version

  37. v3.5.0 02 Nov 2020

    Nothing published for this version

  38. v3.4.1 19 Jun 2020

    Nothing published for this version

  39. v3.4.0 26 May 2020

    Nothing published for this version

  40. v3.3.4 09 Feb 2020

    Nothing published for this version

  41. v3.3.3 20 Jan 2020

    Nothing published for this version

  42. v3.3.2 03 Jan 2020

    Nothing published for this version

  43. v3.3.1 22 Nov 2019

    Nothing published for this version

  44. v3.3.0 20 Nov 2019

    Nothing published for this version

  45. v3.2.3 05 Jul 2019

    Nothing published for this version

  46. v3.2.2 15 Mar 2019

    Nothing published for this version

  47. v3.2.1 27 Nov 2018

    Nothing published for this version

  48. v3.2.0 29 Aug 2018

    Nothing published for this version

  49. v3.1.4 27 Nov 2018

    Nothing published for this version

  50. v3.1.3 09 Aug 2018

    Nothing published for this version

  51. v3.1.2 26 Apr 2018

    Nothing published for this version

  52. v3.1.1 30 Mar 2018

    Nothing published for this version

  53. v3.1.0 16 Aug 2017

    Nothing published for this version

  54. v3.0.5 09 Aug 2018

    Nothing published for this version

  55. v3.0.4 26 Apr 2018

    Nothing published for this version

  56. v3.0.3 30 Mar 2018

    Nothing published for this version

  57. v3.0.2 26 Sep 2017

    Nothing published for this version

  58. v3.0.1 11 Jul 2017

    Nothing published for this version

  59. v3.0.0 18 Mar 2017

    Nothing published for this version

  60. v2.6.4 26 Apr 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive