Skip to content

Bump nette/php-generator from 4.2.0 to 4.2.1#1683

Merged
henriquemoody merged 1 commit into3.0from
dependabot/composer/nette/php-generator-4.2.1
Feb 9, 2026
Merged

Bump nette/php-generator from 4.2.0 to 4.2.1#1683
henriquemoody merged 1 commit into3.0from
dependabot/composer/nette/php-generator-4.2.1

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Feb 9, 2026

Bumps nette/php-generator from 4.2.0 to 4.2.1.

Release notes

Sourced from nette/php-generator's releases.

Released version 4.2.1

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
  • 52aff4d made static analysis mandatory
  • fafa317 fixed PHPStan errors
  • 00e2a35 PhpNamespace::add() passes self to ClassLike (BC break)
  • 0a2ee86 Factory::getAttributes() refactoring to formatAttributes()
  • 33fa22d Factory::fromClassReflection() refactoring
  • 22dfd15 added PhpFile::add()
  • 5c54453 PhpNamespace::add() accepts GlobalFunction
  • 2f73e49 added ClassLike::getFullName()
  • 5800f11 added ClassLike::setNamespace(), replaces parameter $namespace in constructor
  • f8db6bf ClassLike accepts FQN in constructor
  • 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)

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file Patch php Pull requests that update Php code labels Feb 9, 2026
@henriquemoody
Copy link
Copy Markdown
Member

@dependabot rebase

Bumps [nette/php-generator](https://github.com/nette/php-generator) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/nette/php-generator/releases)
- [Commits](nette/php-generator@v4.2.0...v4.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot force-pushed the dependabot/composer/nette/php-generator-4.2.1 branch from d5af908 to 0d11204 Compare February 9, 2026 12:46
@henriquemoody henriquemoody merged commit a0ecc12 into 3.0 Feb 9, 2026
10 checks passed
@henriquemoody henriquemoody deleted the dependabot/composer/nette/php-generator-4.2.1 branch February 9, 2026 12:47
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