Skip to content

chore(deps): bump nette/php-generator from 4.1.8 to 4.2.2#55

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/composer/nette/php-generator-4.2.2
Open

chore(deps): bump nette/php-generator from 4.1.8 to 4.2.2#55
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/composer/nette/php-generator-4.2.2

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 27, 2026

Bumps nette/php-generator from 4.1.8 to 4.2.2.

Release notes

Sourced from nette/php-generator's releases.

Released version 4.2.2

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.

Released version 4.2.0

  • requires PHP 8.1
  • Visibility, PropertyHookType & PropertyAccessMode are enums (BC break)
  • removed deprecated stuff
  • addTrait() second argument is deprecated (BC break)

Released version 4.1.9

  • support for PHP 8.5
  • final promoted property in PHP 8.5
  • optimized global function calls
Commits
  • 0d70609 made static analysis mandatory
  • a2181b0 fixed PHPStan errors
  • e7d0fda uses nette/phpstan-rules
  • 8ab2202 improved phpDoc types
  • 27a950f PhpNamespace::add() passes self to ClassLike (BC break)
  • a666b17 Factory::getAttributes() refactoring to formatAttributes()
  • 1bb8070 Factory::fromClassReflection() refactoring
  • 4d91d21 added PhpFile::add()
  • c16e5ef PhpNamespace::add() accepts GlobalFunction
  • ca0486c added ClassLike::getFullName()
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [nette/php-generator](https://github.com/nette/php-generator) from 4.1.8 to 4.2.2.
- [Release notes](https://github.com/nette/php-generator/releases)
- [Commits](nette/php-generator@v4.1.8...v4.2.2)

---
updated-dependencies:
- dependency-name: nette/php-generator
  dependency-version: 4.2.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants