Skip to content

feat: Implement setNamespace method#65

Open
artengin wants to merge 3 commits intomasterfrom
implement-set-namespace-method
Open

feat: Implement setNamespace method#65
artengin wants to merge 3 commits intomasterfrom
implement-set-namespace-method

Conversation

@artengin
Copy link
Copy Markdown
Contributor

No description provided.

@artengin artengin self-assigned this Apr 30, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94ee5d5fdb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/Visitors/SetNamespace.php Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 30, 2026

Coverage Report for CI Build 25187232264

Coverage decreased (-0.4%) to 97.003%

Details

  • Coverage decreased (-0.4%) from the base build.
  • Patch coverage: 14 of 14 lines across 2 files are fully covered (100%).
  • 2 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

2 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/Visitors/PropertyVisitors/RemoveArrayPropertyItem.php 2 89.66%

Coverage Stats

Coverage Status
Relevant Lines: 367
Covered Lines: 356
Line Coverage: 97.0%
Coverage Strength: 9.08 hits per line

💛 - Coveralls

@artengin
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f34e2fb06a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/Visitors/SetNamespace.php Outdated
{
foreach ($nodes as $node) {
if ($node instanceof Namespace_) {
if ($node->name->toString() === $this->namespace) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle anonymous namespace node before comparing names

Guard this comparison against Namespace_ nodes whose name is null (for example, files using namespace { ... } global blocks). In that case, calling toString() throws at runtime, so setNamespace() crashes instead of rewriting the file. This regression is input-dependent but affects valid PHP files that parse to anonymous namespace nodes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anonymous namespaces cannot be PSR-4 autoloaded, so this case is intentionally not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants