Skip to content

Bump nette/php-generator from 4.2.1 to 4.2.2#1714

Merged
alganet merged 1 commit into3.1from
dependabot/composer/nette/php-generator-4.2.2
Mar 4, 2026
Merged

Bump nette/php-generator from 4.2.1 to 4.2.2#1714
alganet merged 1 commit into3.1from
dependabot/composer/nette/php-generator-4.2.2

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 4, 2026

Bumps nette/php-generator from 4.2.1 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.

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.2.1 to 4.2.2.
- [Release notes](https://github.com/nette/php-generator/releases)
- [Commits](nette/php-generator@v4.2.1...v4.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file Patch php Pull requests that update Php code labels Mar 4, 2026
@alganet alganet merged commit b0b714a into 3.1 Mar 4, 2026
10 checks passed
@alganet alganet deleted the dependabot/composer/nette/php-generator-4.2.2 branch March 4, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Patch php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant