Skip to content

fix: keep the php_namespace verbatim for nested types - #56

Merged
kafkiansky merged 1 commit into
0.6.xfrom
fix/verbatim-php-namespace
Nov 24, 2026
Merged

kafkiansky merged 1 commit into
0.6.xfrom
fix/verbatim-php-namespace

Conversation

@kafkiansky

Copy link
Copy Markdown
Contributor

The PHP namespace of a file was normalised together with the protobuf segments of a type path. With php_namespace = "Foo_Bar\\baz" the top-level classes were declared in Foo_Bar\baz, while nested messages, enums and oneofs went to FooBar\baz\Outer, and the references to them pointed to classes that did not exist.

The namespace of a file is a PHP namespace already, so it is now kept as is and only the protobuf segments are normalised. Top-level classes do not change.

The PHP namespace of a file was normalised together with the protobuf
segments of a type path. With `php_namespace = "Foo_Bar\\baz"` the
top-level classes were declared in Foo_Bar\baz, while nested messages,
enums and oneofs went to FooBar\baz\Outer, and the references to them
pointed to classes that did not exist.

The namespace of a file is a PHP namespace already, so it is now kept
as is and only the protobuf segments are normalised. Top-level classes
do not change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@kafkiansky kafkiansky self-assigned this Nov 24, 2026
@kafkiansky kafkiansky added the bug Something isn't working label Nov 24, 2026
@kafkiansky
kafkiansky merged commit dd640eb into 0.6.x Nov 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant